From 69f0e6b0bf0dc0a6c6fe8ccf17c74960697ca10c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 8 Feb 2009 01:37:25 +0000 Subject: 1.0 released --- LICENSE.txt | 339 +++++++ MANIFEST.MF | 6 + Makefile | 64 ++ README.txt | 107 +++ SSL/README.txt | 2 + SSL/alice.cer | Bin 0 -> 786 bytes SSL/bob.cer | Bin 0 -> 782 bytes SSL/clientKeys | Bin 0 -> 2472 bytes SSL/clientTrust | Bin 0 -> 851 bytes SSL/server.cer | Bin 0 -> 788 bytes SSL/serverKeys | Bin 0 -> 1258 bytes SSL/serverTrust | Bin 0 -> 1658 bytes calendardb/calendar | 4 + calendardb/calendar.Birthday | 16 + calendardb/calendar.Diverse | 0 calendardb/calendar.EXA | 0 calendardb/calendar.Studies | 17 + client/AboutWindow.java | 49 + client/CalendarTableCellRenderer.java | 135 +++ client/CalendarTableModel.java | 434 +++++++++ client/InfoWindow.java | 57 ++ client/LicenseWindow.java | 33 + client/NetCalendarClient.java | 731 ++++++++++++++ client/ServerRequester.java | 82 ++ client/SplashScreen.java | 42 + client/SubWindow.java | 101 ++ client/helper/DateSpinner.java | 57 ++ client/helper/GUIHelper.java | 189 ++++ client/inputforms/AdvancedSearching.java | 140 +++ client/inputforms/CreateNewEvent.java | 122 +++ client/inputforms/EditExistingEvent.java | 156 +++ client/inputforms/InputForm.java | 93 ++ client/inputforms/Preferences.java | 99 ++ client/inputforms/RenameCategory.java | 123 +++ config.txt | 12 + images/netcal.png | Bin 0 -> 131869 bytes javadoc/allclasses-frame.html | 74 ++ javadoc/allclasses-noframe.html | 74 ++ javadoc/client/CalendarTableCellRenderer.html | 398 ++++++++ javadoc/client/CalendarTableModel.html | 777 +++++++++++++++ javadoc/client/NetCalendarClient.html | 562 +++++++++++ javadoc/client/ServerRequester.html | 264 +++++ .../class-use/CalendarTableCellRenderer.html | 136 +++ javadoc/client/class-use/CalendarTableModel.html | 170 ++++ javadoc/client/class-use/NetCalendarClient.html | 196 ++++ javadoc/client/class-use/ServerRequester.html | 136 +++ javadoc/client/helper/DateSpinner.html | 365 +++++++ javadoc/client/helper/GUIHelper.html | 319 ++++++ javadoc/client/helper/class-use/DateSpinner.html | 136 +++ javadoc/client/helper/class-use/GUIHelper.html | 136 +++ javadoc/client/helper/package-frame.html | 34 + javadoc/client/helper/package-summary.html | 152 +++ javadoc/client/helper/package-tree.html | 153 +++ javadoc/client/helper/package-use.html | 136 +++ javadoc/client/inputforms/AdvancedSearching.html | 348 +++++++ javadoc/client/inputforms/CreateNewEvent.html | 346 +++++++ javadoc/client/inputforms/EditExistingEvent.html | 348 +++++++ javadoc/client/inputforms/InputForm.html | 350 +++++++ javadoc/client/inputforms/Preferences.html | 346 +++++++ .../inputforms/class-use/AdvancedSearching.html | 136 +++ .../inputforms/class-use/CreateNewEvent.html | 136 +++ .../inputforms/class-use/EditExistingEvent.html | 136 +++ javadoc/client/inputforms/class-use/InputForm.html | 196 ++++ .../client/inputforms/class-use/Preferences.html | 136 +++ javadoc/client/inputforms/package-frame.html | 40 + javadoc/client/inputforms/package-summary.html | 164 ++++ javadoc/client/inputforms/package-tree.html | 161 ++++ javadoc/client/inputforms/package-use.html | 162 ++++ javadoc/client/package-frame.html | 38 + javadoc/client/package-summary.html | 161 ++++ javadoc/client/package-tree.html | 171 ++++ javadoc/client/package-use.html | 181 ++++ javadoc/constant-values.html | 272 ++++++ javadoc/deprecated-list.html | 134 +++ javadoc/help-doc.html | 193 ++++ javadoc/index-files/index-1.html | 158 +++ javadoc/index-files/index-10.html | 140 +++ javadoc/index-files/index-11.html | 140 +++ javadoc/index-files/index-12.html | 180 ++++ javadoc/index-files/index-13.html | 239 +++++ javadoc/index-files/index-14.html | 143 +++ javadoc/index-files/index-15.html | 147 +++ javadoc/index-files/index-16.html | 137 +++ javadoc/index-files/index-17.html | 137 +++ javadoc/index-files/index-2.html | 178 ++++ javadoc/index-files/index-3.html | 159 +++ javadoc/index-files/index-4.html | 140 +++ javadoc/index-files/index-5.html | 143 +++ javadoc/index-files/index-6.html | 241 +++++ javadoc/index-files/index-7.html | 138 +++ javadoc/index-files/index-8.html | 149 +++ javadoc/index-files/index-9.html | 186 ++++ javadoc/index.html | 26 + javadoc/overview-frame.html | 52 + javadoc/overview-summary.html | 164 ++++ javadoc/overview-tree.html | 192 ++++ javadoc/package-list | 6 + javadoc/packages.html | 31 + javadoc/resources/inherit.gif | Bin 0 -> 57 bytes javadoc/serialized-form.html | 1016 ++++++++++++++++++++ javadoc/server/CalendarDatabase.html | 439 +++++++++ javadoc/server/CalendarFormatParser.html | 311 ++++++ javadoc/server/NetCalendarServer.html | 296 ++++++ javadoc/server/class-use/CalendarDatabase.html | 136 +++ javadoc/server/class-use/CalendarFormatParser.html | 136 +++ javadoc/server/class-use/NetCalendarServer.html | 136 +++ javadoc/server/package-frame.html | 36 + javadoc/server/package-summary.html | 156 +++ javadoc/server/package-tree.html | 148 +++ javadoc/server/package-use.html | 136 +++ javadoc/shared/CalendarCategory.html | 522 ++++++++++ javadoc/shared/CalendarEvent.html | 809 ++++++++++++++++ javadoc/shared/Config.html | 491 ++++++++++ javadoc/shared/Main.html | 331 +++++++ javadoc/shared/MyDate.html | 298 ++++++ javadoc/shared/MyVector.html | 295 ++++++ javadoc/shared/class-use/CalendarCategory.html | 231 +++++ javadoc/shared/class-use/CalendarEvent.html | 335 +++++++ javadoc/shared/class-use/Config.html | 136 +++ javadoc/shared/class-use/Main.html | 136 +++ javadoc/shared/class-use/MyDate.html | 172 ++++ javadoc/shared/class-use/MyVector.html | 136 +++ javadoc/shared/package-frame.html | 42 + javadoc/shared/package-summary.html | 169 ++++ javadoc/shared/package-tree.html | 158 +++ javadoc/shared/package-use.html | 256 +++++ javadoc/shared/remotecall/ClientRequest.html | 794 +++++++++++++++ javadoc/shared/remotecall/RemoteCall.html | 232 +++++ javadoc/shared/remotecall/ServerResponse.html | 273 ++++++ .../shared/remotecall/class-use/ClientRequest.html | 263 +++++ .../shared/remotecall/class-use/RemoteCall.html | 181 ++++ .../remotecall/class-use/ServerResponse.html | 188 ++++ javadoc/shared/remotecall/package-frame.html | 36 + javadoc/shared/remotecall/package-summary.html | 157 +++ javadoc/shared/remotecall/package-tree.html | 149 +++ javadoc/shared/remotecall/package-use.html | 228 +++++ javadoc/stylesheet.css | 29 + netcalendar.log | 0 server/CalendarDatabase.java | 271 ++++++ server/CalendarFormatParser.java | 269 ++++++ server/NetCalendarServer.java | 160 +++ shared/CalendarCategory.java | 223 +++++ shared/CalendarEvent.java | 339 +++++++ shared/Config.java | 236 +++++ shared/DoCallback.java | 10 + shared/Main.java | 125 +++ shared/MyDate.java | 54 ++ shared/MyVector.java | 23 + shared/remotecall/ClientRequest.java | 369 +++++++ shared/remotecall/RemoteCall.java | 29 + shared/remotecall/ServerResponse.java | 53 + 151 files changed, 26963 insertions(+) create mode 100644 LICENSE.txt create mode 100644 MANIFEST.MF create mode 100644 Makefile create mode 100644 README.txt create mode 100644 SSL/README.txt create mode 100644 SSL/alice.cer create mode 100644 SSL/bob.cer create mode 100644 SSL/clientKeys create mode 100644 SSL/clientTrust create mode 100644 SSL/server.cer create mode 100644 SSL/serverKeys create mode 100644 SSL/serverTrust create mode 100644 calendardb/calendar create mode 100644 calendardb/calendar.Birthday create mode 100644 calendardb/calendar.Diverse create mode 100644 calendardb/calendar.EXA create mode 100644 calendardb/calendar.Studies create mode 100644 client/AboutWindow.java create mode 100644 client/CalendarTableCellRenderer.java create mode 100644 client/CalendarTableModel.java create mode 100644 client/InfoWindow.java create mode 100644 client/LicenseWindow.java create mode 100644 client/NetCalendarClient.java create mode 100644 client/ServerRequester.java create mode 100644 client/SplashScreen.java create mode 100644 client/SubWindow.java create mode 100644 client/helper/DateSpinner.java create mode 100644 client/helper/GUIHelper.java create mode 100644 client/inputforms/AdvancedSearching.java create mode 100644 client/inputforms/CreateNewEvent.java create mode 100644 client/inputforms/EditExistingEvent.java create mode 100644 client/inputforms/InputForm.java create mode 100644 client/inputforms/Preferences.java create mode 100644 client/inputforms/RenameCategory.java create mode 100644 config.txt create mode 100644 images/netcal.png create mode 100644 javadoc/allclasses-frame.html create mode 100644 javadoc/allclasses-noframe.html create mode 100644 javadoc/client/CalendarTableCellRenderer.html create mode 100644 javadoc/client/CalendarTableModel.html create mode 100644 javadoc/client/NetCalendarClient.html create mode 100644 javadoc/client/ServerRequester.html create mode 100644 javadoc/client/class-use/CalendarTableCellRenderer.html create mode 100644 javadoc/client/class-use/CalendarTableModel.html create mode 100644 javadoc/client/class-use/NetCalendarClient.html create mode 100644 javadoc/client/class-use/ServerRequester.html create mode 100644 javadoc/client/helper/DateSpinner.html create mode 100644 javadoc/client/helper/GUIHelper.html create mode 100644 javadoc/client/helper/class-use/DateSpinner.html create mode 100644 javadoc/client/helper/class-use/GUIHelper.html create mode 100644 javadoc/client/helper/package-frame.html create mode 100644 javadoc/client/helper/package-summary.html create mode 100644 javadoc/client/helper/package-tree.html create mode 100644 javadoc/client/helper/package-use.html create mode 100644 javadoc/client/inputforms/AdvancedSearching.html create mode 100644 javadoc/client/inputforms/CreateNewEvent.html create mode 100644 javadoc/client/inputforms/EditExistingEvent.html create mode 100644 javadoc/client/inputforms/InputForm.html create mode 100644 javadoc/client/inputforms/Preferences.html create mode 100644 javadoc/client/inputforms/class-use/AdvancedSearching.html create mode 100644 javadoc/client/inputforms/class-use/CreateNewEvent.html create mode 100644 javadoc/client/inputforms/class-use/EditExistingEvent.html create mode 100644 javadoc/client/inputforms/class-use/InputForm.html create mode 100644 javadoc/client/inputforms/class-use/Preferences.html create mode 100644 javadoc/client/inputforms/package-frame.html create mode 100644 javadoc/client/inputforms/package-summary.html create mode 100644 javadoc/client/inputforms/package-tree.html create mode 100644 javadoc/client/inputforms/package-use.html create mode 100644 javadoc/client/package-frame.html create mode 100644 javadoc/client/package-summary.html create mode 100644 javadoc/client/package-tree.html create mode 100644 javadoc/client/package-use.html create mode 100644 javadoc/constant-values.html create mode 100644 javadoc/deprecated-list.html create mode 100644 javadoc/help-doc.html create mode 100644 javadoc/index-files/index-1.html create mode 100644 javadoc/index-files/index-10.html create mode 100644 javadoc/index-files/index-11.html create mode 100644 javadoc/index-files/index-12.html create mode 100644 javadoc/index-files/index-13.html create mode 100644 javadoc/index-files/index-14.html create mode 100644 javadoc/index-files/index-15.html create mode 100644 javadoc/index-files/index-16.html create mode 100644 javadoc/index-files/index-17.html create mode 100644 javadoc/index-files/index-2.html create mode 100644 javadoc/index-files/index-3.html create mode 100644 javadoc/index-files/index-4.html create mode 100644 javadoc/index-files/index-5.html create mode 100644 javadoc/index-files/index-6.html create mode 100644 javadoc/index-files/index-7.html create mode 100644 javadoc/index-files/index-8.html create mode 100644 javadoc/index-files/index-9.html create mode 100644 javadoc/index.html create mode 100644 javadoc/overview-frame.html create mode 100644 javadoc/overview-summary.html create mode 100644 javadoc/overview-tree.html create mode 100644 javadoc/package-list create mode 100644 javadoc/packages.html create mode 100644 javadoc/resources/inherit.gif create mode 100644 javadoc/serialized-form.html create mode 100644 javadoc/server/CalendarDatabase.html create mode 100644 javadoc/server/CalendarFormatParser.html create mode 100644 javadoc/server/NetCalendarServer.html create mode 100644 javadoc/server/class-use/CalendarDatabase.html create mode 100644 javadoc/server/class-use/CalendarFormatParser.html create mode 100644 javadoc/server/class-use/NetCalendarServer.html create mode 100644 javadoc/server/package-frame.html create mode 100644 javadoc/server/package-summary.html create mode 100644 javadoc/server/package-tree.html create mode 100644 javadoc/server/package-use.html create mode 100644 javadoc/shared/CalendarCategory.html create mode 100644 javadoc/shared/CalendarEvent.html create mode 100644 javadoc/shared/Config.html create mode 100644 javadoc/shared/Main.html create mode 100644 javadoc/shared/MyDate.html create mode 100644 javadoc/shared/MyVector.html create mode 100644 javadoc/shared/class-use/CalendarCategory.html create mode 100644 javadoc/shared/class-use/CalendarEvent.html create mode 100644 javadoc/shared/class-use/Config.html create mode 100644 javadoc/shared/class-use/Main.html create mode 100644 javadoc/shared/class-use/MyDate.html create mode 100644 javadoc/shared/class-use/MyVector.html create mode 100644 javadoc/shared/package-frame.html create mode 100644 javadoc/shared/package-summary.html create mode 100644 javadoc/shared/package-tree.html create mode 100644 javadoc/shared/package-use.html create mode 100644 javadoc/shared/remotecall/ClientRequest.html create mode 100644 javadoc/shared/remotecall/RemoteCall.html create mode 100644 javadoc/shared/remotecall/ServerResponse.html create mode 100644 javadoc/shared/remotecall/class-use/ClientRequest.html create mode 100644 javadoc/shared/remotecall/class-use/RemoteCall.html create mode 100644 javadoc/shared/remotecall/class-use/ServerResponse.html create mode 100644 javadoc/shared/remotecall/package-frame.html create mode 100644 javadoc/shared/remotecall/package-summary.html create mode 100644 javadoc/shared/remotecall/package-tree.html create mode 100644 javadoc/shared/remotecall/package-use.html create mode 100644 javadoc/stylesheet.css create mode 100644 netcalendar.log create mode 100644 server/CalendarDatabase.java create mode 100644 server/CalendarFormatParser.java create mode 100644 server/NetCalendarServer.java create mode 100644 shared/CalendarCategory.java create mode 100644 shared/CalendarEvent.java create mode 100644 shared/Config.java create mode 100644 shared/DoCallback.java create mode 100644 shared/Main.java create mode 100644 shared/MyDate.java create mode 100644 shared/MyVector.java create mode 100644 shared/remotecall/ClientRequest.java create mode 100644 shared/remotecall/RemoteCall.java create mode 100644 shared/remotecall/ServerResponse.java diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..1fa73f2 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, 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 + + Appendix: 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. + + + Copyright (C) 19yy + + 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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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. + + , 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/MANIFEST.MF b/MANIFEST.MF new file mode 100644 index 0000000..8a0822f --- /dev/null +++ b/MANIFEST.MF @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +Ant-Version: Apache Ant 1.7.0 +Created-By: 11.2-b01 (Sun Microsystems Inc.) +Built-By: Dipl.-Inform. (FH) Paul C. Buetow +Main-Class: shared/Main + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0404568 --- /dev/null +++ b/Makefile @@ -0,0 +1,64 @@ +PASSWORD=123456 +all: + javac shared/Main.java +run: + java shared/Main +sslclientrun: + java \ + -Djavax.net.ssl.keyStore=./SSL/clientKeys \ + -Djavax.net.ssl.keyStorePassword=$(PASSWORD) \ + -Djavax.net.ssl.trustStore=./SSL/clientTrust \ + -Djavax.net.ssl.trustStorePassword=$(PASSWORD) \ + shared/Main --client-only --server-address=localhost + +sslserverrun: + java \ + -Djavax.net.ssl.keyStore=./SSL/serverKeys \ + -Djavax.net.ssl.keyStorePassword=$(PASSWORD) \ + -Djavax.net.ssl.trustStore=./SSL/serverTrust \ + -Djavax.net.ssl.trustStorePassword=$(PASSWORD) \ + shared/Main --server-only +test: all run +t: test +err: + sh -c 'make 2> err' +clean: + find ./ -name '*.class' -exec rm -f {} \; + find . -name '*.jar' -exec rm -f {} \; + if [ -d ./dist ]; then rm -Rf dist; fi +astyle: + find ./ -name '*.java' -exec sh -c 'astyle -s2 {}; rm -f {}.orig' \; +check: + for f in `find ./ -name '*.[ch]'`; do awk -v f=$$f \ + '{ if (length($$0) > 80) { \ + printf "Max line length reached @ %s:%d => %d\n", \ + f, NR, length($$0) } }' $$f; done +stats: + @sh -c 'wc=`find ./ -name "*.java" | xargs wc -l`; \ + echo "===> Num source files : `echo \"$$wc\" | \ + grep -E \"\\.java$$\" | wc -l`"; \ + echo "===> Num of source lines: `echo \"$$wc\" | \ + tail -n 1 | sed s/total//`"' +newline: + @echo +replace: + find ./ -name '*.java' -exec sh -c 'sed -n "s/$(FROM)/$(INTO)/g; \ + w .tmp" {} && mv -f .tmp {}' \; +headers: + @find ./ -name '*.java' -exec sh -c 'export FILE={}; \ + make header' \; +header: + @echo "===> Processing $(FILE)" + @sed -n '/*:/d; w .tmp' $(FILE) + @header=`sed 's/\(.*\)/ echo " \*: \1"/' $(HEADER)`; \ + echo '/*:*' > $(FILE); eval "$$header" >> $(FILE); \ + echo ' *:*/' >> $(FILE); cat .tmp >> $(FILE); rm -f .tmp +sslkeygen: + keytool -genkey -keystore mySrvKeystore -keyalg RSA +createjar: clean all + jar cvfm NetCalendar.jar MANIFEST.MF `find . -name \*.class` +createdist: createjar + mkdir ./dist + cp NetCalendar.jar dist + cp -R *.txt calendardb config.txt images SSL ./dist + find ./dist -type d -name .svn | xargs rm -Rf diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..5f894db --- /dev/null +++ b/README.txt @@ -0,0 +1,107 @@ +Copyright: (c) 2009 Dipl.-Inform. (FH) Paul C. Buetow +WWW: http://netcalendar.buetow.org +Mail: netcalendar@dev.buetow.org + +Quick howto for the NetCalendar + +I. HOW TO START THE NETCALENDAR STAND ALONE (WITHOUT SSL): +II. HOW TO START THE NETCALENDAR DISTRIBUTED (WITHOUT SSL): +III. HOW TO START THE NETCALENDAR DISTRIBUTED (WITH SSL): +IV. MORE OPTIONS +V. INFORMATIONS CONCERNING THE COLORS BEING USED WITHIN THE NETCALENDAR CLIENT: +VI. USING THE UNIX CALENDAR DATABASE + + +I. HOW TO START THE NETCALENDAR STAND ALONE (WITHOUT SSL): + +You need at least a JRE 6 or higher. The command + + java -jar NetCalendar.jar --client-and-server + +is starting the client and the server of the NetCalendar within the same +process as two different threads. The option "server_address" will be set +automatically to "localhost". The communication between both threads is done +per TCP/IP. + + +II. HOW TO START THE NETCALENDAR DISTRIBUTED (WITHOUT SSL): + +1. Server and client should use, if possible, the same version of the JRE. + +2. You should copy the complete NetCalendar suite to the client and the server +computer. + +3. Start the server with + + java -jar NetCalendar.jar --server-only + +4. Start the server with + + java -jar NetCalendar.jar --client-only \ + --server-address=$SERVERHOST + +In order to stop the server, select "Server -> Shutdown server" in the GUI of +the client. + + +III. HOW TO START THE NETCALENDAR DISTRIBUTED (WITH SSL): + +1. Server and client should use, if possible, the same version of the JRE. + +2. You should copy the complete NetCalendar suite to the client and the server +computer. On edit on both sides (server and client) the conf.txt and set +use_ssl to true. + +3. You should create clientKeys,clientTrust,serverKeys and serverTrust as +discribed in http://www.ibm.com/developerworks/java/library/j-customssl/ and +save them for example into ./SSL. + +3. Start the server with + java \ + -Djavax.net.ssl.keyStore=./SSL/serverKeys \ + -Djavax.net.ssl.keyStorePassword=$PASSWORD \ + -Djavax.net.ssl.trustStore=./SSL/serverTrust \ + -Djavax.net.ssl.trustStorePassword=$PASSWORD \ + -jar NetCalendar.jar --server-only + +4. Start the server with + java \ + -Djavax.net.ssl.keyStore=./SSL/clientKeys \ + -Djavax.net.ssl.keyStorePassword=$PASSWORD \ + -Djavax.net.ssl.trustStore=./SSL/clientTrust \ + -Djavax.net.ssl.trustStorePassword=$PASSWORD \ + -jar NetCalendar.jar --client-only --server-address=$SERVERHOST + + +IV. MORE OPTIONS + +All options will be set to their default values while starting the NetCalendar +without any explicit options given. + +If you want to see more available parameters, then run the command + + java -jar NetCalendar.jar --help + +It is possible to configure the NetCalendar by editing the configuration file +which is "config.txt". However, the preferred way is using the client GUI via +"Session -> Preferences". + + +V. INFORMATIONS CONCERNING THE COLORS BEING USED WITHIN THE NETCALENDAR CLIENT: + +Blue in the "Date" column: Yearly event +Green in the "Date" column: The event will take place only once + +Red: Event takes place within the next 24h +Orange: Event takes place within the next week +Yellow: Event takes place within the next 28 days +Dark: Event takes place within the next 168 days (~ 1/2 year) +Light beige: Event takes place within the next 365 days (1 year) +Grey: Event takes place after 365 days + + +VI. USING THE UNIX CALENDAR DATABASE + +If you are using the 'calendar' tool on UNIX, you can use ~/.calendar as your +NetCalendar database dir :) + diff --git a/SSL/README.txt b/SSL/README.txt new file mode 100644 index 0000000..e91baa6 --- /dev/null +++ b/SSL/README.txt @@ -0,0 +1,2 @@ +See http://www.ibm.com/developerworks/java/library/j-customssl/ for creating +your own SSL keys etc. diff --git a/SSL/alice.cer b/SSL/alice.cer new file mode 100644 index 0000000..f93fa1d Binary files /dev/null and b/SSL/alice.cer differ diff --git a/SSL/bob.cer b/SSL/bob.cer new file mode 100644 index 0000000..a687b18 Binary files /dev/null and b/SSL/bob.cer differ diff --git a/SSL/clientKeys b/SSL/clientKeys new file mode 100644 index 0000000..635162d Binary files /dev/null and b/SSL/clientKeys differ diff --git a/SSL/clientTrust b/SSL/clientTrust new file mode 100644 index 0000000..3b1fda5 Binary files /dev/null and b/SSL/clientTrust differ diff --git a/SSL/server.cer b/SSL/server.cer new file mode 100644 index 0000000..afd3e1d Binary files /dev/null and b/SSL/server.cer differ diff --git a/SSL/serverKeys b/SSL/serverKeys new file mode 100644 index 0000000..4fbfa56 Binary files /dev/null and b/SSL/serverKeys differ diff --git a/SSL/serverTrust b/SSL/serverTrust new file mode 100644 index 0000000..1a59249 Binary files /dev/null and b/SSL/serverTrust differ diff --git a/calendardb/calendar b/calendardb/calendar new file mode 100644 index 0000000..9b5fb81 --- /dev/null +++ b/calendardb/calendar @@ -0,0 +1,4 @@ +#include +#include +#include +#include diff --git a/calendardb/calendar.Birthday b/calendardb/calendar.Birthday new file mode 100644 index 0000000..74b1003 --- /dev/null +++ b/calendardb/calendar.Birthday @@ -0,0 +1,16 @@ +01/22 yearly-00:00 Name 15 +12/30 yearly-00:00 Name 14 +02/19 yearly-00:00 Name 19 +03/12 yearly-00:00 Name 20 +03/25 yearly-00:00 Name 22 +06/20 yearly-00:00 Name 6 +07/08 yearly-00:00 Name 8 +12/01 yearly-00:00 Name 13 +09/26 yearly-00:00 Name 10 +03/21 yearly-00:00 Name 21 +05/03 yearly-00:00 Name 2 +02/05 yearly-00:00 Name 17 +09/25 yearly-00:00 Name 9 +02/18 yearly-00:00 Name 18 +02/04 yearly-00:00 Name 16 +10/13 yearly-00:00 Name 12 diff --git a/calendardb/calendar.Diverse b/calendardb/calendar.Diverse new file mode 100644 index 0000000..e69de29 diff --git a/calendardb/calendar.EXA b/calendardb/calendar.EXA new file mode 100644 index 0000000..e69de29 diff --git a/calendardb/calendar.Studies b/calendardb/calendar.Studies new file mode 100644 index 0000000..a591e7d --- /dev/null +++ b/calendardb/calendar.Studies @@ -0,0 +1,17 @@ +06/30 2006-00:00 Ende der Rückmeldesfrist +07/03 2006-00:00 Ende der Nachmeldefrist (10 EUR Verspaetungsgebühr) +09/01 2006-00:00 Semesterbegin +09/18 2006-00:00 Vorlesungsbeginn +02/09 2007-00:00 Vorlesungsschluss +02/28 2007-00:00 Semesterschluss +06/30 2006-00:00 Anfang der Prüfungszeit +07/10 2006-08:30 DTTI Pruefung +07/10 2006-01:30 PFI Pruefung +07/14 2006-00:00 Ende der Pruefungszeit +08/19 2006-00:00 Anmeldung zu den Pruefungen +09/18 2006-00:00 Anfang der Prüfungszeit +09/18 2006-08:30 SWE Prüfung +09/20 2006-01:30 GCN Prüfung +09/25 2006-01:30 OSS Prüfung +09/29 2006-00:00 Ende der Pruefungszeit +05/02 2006-00:00 Anfgang der Rückmeldesfrist diff --git a/client/AboutWindow.java b/client/AboutWindow.java new file mode 100644 index 0000000..d3e8008 --- /dev/null +++ b/client/AboutWindow.java @@ -0,0 +1,49 @@ +package client; + +import shared.*; + +/** + * This window simply shows an about message about the + * netcalendar. + * @author paul.buetow + * + */ +public class AboutWindow extends InfoWindow { + final static long serialVersionUID = 1L; + /** + * Creates the window and shows it. + * @param sTitleText Specifies the title text of this JFrame. + * @param netCalendarClient Specifies the calendar client session object to use. + */ + public AboutWindow(NetCalendarClient netCalendarClient) { + super(netCalendarClient, "About", + Config.VERSION + "\n" + + "Copyright (C) 2006, 2009 by Paul C. Buetow; " + + "Web: netcalendar.buetow.org; E-Mail: " + getEmailAddr() + "\n\n" + + "NetCalendar is a network capable and mostly UNIX /usr/bin/calendar database compatible Calendar application " + + "programmed in Java. Its initial motivation was a programming project at the Aachen " + + "University of Applied Sciences (www.fh-aachen.de) for the object oriented " + + "programming class. But it became much more than just that!\n\n" + + "Credits:\n\n" + + "Bernhard Schertl " + + "for testing and suggestions for improvements; Web: www.b78.org\n\n" + + "Prof. Dr. rer. nat. H. Fassbender " + + "for supervision of expert opinion; Web: www.fassbender.fh-aachen.de\n\n" + + "Florian P. Buetow " + + "for ideas concerning the splash image; Web: www.florianbuetow.com" + ); + } + + /** + * This method simply returns a string containing the contact email address. + * This method is needed to protect this sourcecode + the email address for + * internet spam because some spambots try to fetch this address from the + * cvsweb interface. + * @return Returns a string containing the contact email address. + */ + private static String getEmailAddr() { + String sEmail = "netcalendar at dev dot buetow dot org"; + sEmail = sEmail.replaceAll(" at ", "@"); + return sEmail.replaceAll(" dot ", "."); + } +} diff --git a/client/CalendarTableCellRenderer.java b/client/CalendarTableCellRenderer.java new file mode 100644 index 0000000..11d2a1c --- /dev/null +++ b/client/CalendarTableCellRenderer.java @@ -0,0 +1,135 @@ +package client; + +import java.awt.*; + +import javax.swing.*; +import javax.swing.table.*; +import java.util.*; + +import shared.*; + +/** + * This class is responsible for the rendering of the JTable of the client gui which contains + * all the events. + * @author buetow + */ +public class CalendarTableCellRenderer extends DefaultTableCellRenderer { + private static final long serialVersionUID = 1L; + private CalendarTableModel tableModel; + // private NetCalendarClient netCalendarClient; + + private static final Color SELECTED_BACKGROUND_COLOR; + private static final Color SELECTED_FOREGROUND_COLOR; + private static final Color ALREADY_OVER_BACKGROUND_COLOR; + private static final Color ALREADY_OVER_FOREGROUND_COLOR; + private static final Color STANDARD_FOREGROUND_COLOR; + private static final Color BACKGROUND_COLOR_1_DAY; + private static final Color BACKGROUND_COLOR_7_DAYS; + private static final Color BACKGROUND_COLOR_28_DAYS; + private static final Color BACKGROUND_COLOR_168_DAYS; + private static final Color BACKGROUND_COLOR_365_DAYS; + private static final Color BACKGROUND_COLOR_MT_365_DAYS; + private static final Color YEARLY_BACKGROUND_COLOR; + private static final Color NOT_YEARLY_BACKGROUND_COLOR; + + + private static final long NANOSECONDS_1_DAY; + private static final long NANOSECONDS_7_DAYS; + private static final long NANOSECONDS_28_DAYS; + private static final long NANOSECONDS_168_DAYS; + private static final long NANOSECONDS_365_DAYS; + + // Initialize once, use often! + static { + SELECTED_BACKGROUND_COLOR = new Color(0, 0, 0); + SELECTED_FOREGROUND_COLOR = new Color(255, 255, 255); + STANDARD_FOREGROUND_COLOR = new Color(0, 0, 0); + ALREADY_OVER_FOREGROUND_COLOR = SELECTED_BACKGROUND_COLOR; + ALREADY_OVER_BACKGROUND_COLOR = SELECTED_FOREGROUND_COLOR; + BACKGROUND_COLOR_1_DAY = new Color(0xff, 0x00, 0x00); + BACKGROUND_COLOR_7_DAYS = new Color(0xff, 0x6c, 0x00); + BACKGROUND_COLOR_28_DAYS = new Color(0xff, 0xa5, 0x00); + BACKGROUND_COLOR_168_DAYS = new Color(0xe7, 0xa5, 0x5e); + BACKGROUND_COLOR_365_DAYS = new Color(230, 218, 161); + BACKGROUND_COLOR_MT_365_DAYS = new Color(0xa2, 0x9c, 0x90); // For more than 365 days + + YEARLY_BACKGROUND_COLOR = new Color(0x65, 0xa9, 0xe3); + NOT_YEARLY_BACKGROUND_COLOR = new Color(0x88, 0xe0, 0x90); + + + NANOSECONDS_1_DAY = 3600 * 24 * 1000; + NANOSECONDS_7_DAYS = NANOSECONDS_1_DAY * 7; + NANOSECONDS_28_DAYS = NANOSECONDS_7_DAYS * 4; + NANOSECONDS_168_DAYS = NANOSECONDS_28_DAYS * 6; + NANOSECONDS_365_DAYS = NANOSECONDS_1_DAY * 365; + } + + /** + * This method creates a custom table cell renderer for the calendar client. + * Its coloring the different cells and sets other special display attributes. + * @param tableModel Specifies the DefaultTableModel object used by the JTable. This is needed to make decisions about displaying a specific cell. + */ + public CalendarTableCellRenderer(CalendarTableModel tableModel) { + // this.netCalendarClient = netCalendarClient; + this.tableModel = tableModel; + } + + /** + * This method returns the Component object of a specific table cell. + * @param jTable Specifies the table object of the calendar client frame. + * @param object Specifies the object which is inside of the specific table cell. + * @param isSelected Specifies if the current cell is selected or not. + * @param hasFocus Specifies if the current cell is focused or not. + * @param iRow Specifies thr row number of the current cell. + * @param iCol specifies the column number of the current cell. + * @return Returns the Component object of a specific table cell. + */ + public Component getTableCellRendererComponent(JTable jTable, Object object, + boolean isSelected, boolean hasFocus, int iRow, int iCol){ + JLabel jLable =(JLabel) super.getTableCellRendererComponent(jTable, object, isSelected, hasFocus, iRow, iCol); + + //MyVector vecSelected = netCalendarClient.getSelectedIndexes(); + + //if (vecSelected.hasLike(new Integer(iRow))) { + if (isSelected) { + jLable.setBackground(SELECTED_BACKGROUND_COLOR); + jLable.setForeground(SELECTED_FOREGROUND_COLOR); + return jLable; + } + + CalendarEvent calendarEvent = tableModel.getEvent(iRow); + jLable.setForeground(STANDARD_FOREGROUND_COLOR); + + if (iCol <= 1) { + if (!calendarEvent.isYearly()) + jLable.setBackground(NOT_YEARLY_BACKGROUND_COLOR); + else + jLable.setBackground(YEARLY_BACKGROUND_COLOR); + + return jLable; + } + + long lCurrentTime = new Date().getTime(); + long lEventTime = calendarEvent.getDate().getTime(); + + if (lCurrentTime + NANOSECONDS_1_DAY > lEventTime) + jLable.setBackground(BACKGROUND_COLOR_1_DAY); + + else if (lCurrentTime + NANOSECONDS_7_DAYS > lEventTime) + jLable.setBackground(BACKGROUND_COLOR_7_DAYS); + + else if (lCurrentTime + NANOSECONDS_28_DAYS > lEventTime) + jLable.setBackground(BACKGROUND_COLOR_28_DAYS); + + else if (lCurrentTime + NANOSECONDS_168_DAYS > lEventTime) + jLable.setBackground(BACKGROUND_COLOR_168_DAYS); + + else if (lCurrentTime + NANOSECONDS_365_DAYS > lEventTime) + jLable.setBackground(BACKGROUND_COLOR_365_DAYS); + + else + jLable.setBackground(BACKGROUND_COLOR_MT_365_DAYS); + + return jLable; + } +} diff --git a/client/CalendarTableModel.java b/client/CalendarTableModel.java new file mode 100644 index 0000000..146c20b --- /dev/null +++ b/client/CalendarTableModel.java @@ -0,0 +1,434 @@ +package client; + +import javax.swing.table.*; +import javax.swing.*; +import java.util.*; +import shared.*; +import shared.remotecall.*; + +/** + * This class defined the table model of the JTable of the main calendar client window. All table + * data and most of the table actions, like sorting or updating the content, go trough this class. + * @author buetow + * + */ +public final class CalendarTableModel extends AbstractTableModel { + public static final String NUM_HEADER = "#"; + public static final String DATE_HEADER = "Date"; + public static final String CATEGORY_HEADER = "Category"; + public static final String DESCRIPTION_HEADER = "Description"; + public static final String PLACE_HEADER = "Place"; + + private static final int iEnumLength = Config.getStringValue("client_max_events").length(); + private static final long serialVersionUID = 1L; + private static final int iCols = 5; // Num of columns never changes! + private int iRows = 0; + private Vector vecEvents; + private Comparator lastSortComparator = null; + private JTable jTable; + + /** + * Simple constructor, creates a calendar table model to be used with the JTable of the netcalendar client main window. + * @param jTable Specifies the JTable object of this table model. + */ + public CalendarTableModel(JTable jTable) { + this.jTable = jTable; + } + + /** + * This method returns the number of columns of the JTable. + * @return Returns the number of columns of the JTable. + */ + public int getColumnCount() { + return iCols; + } + + /** + * This method retuns the number of rows of the JTable. + * @return Returns the number of rows of the JTable. + */ + public int getRowCount() { + return iRows; + } + + /** + * This method sets the number of rows of the JTable. + * @param iRows Specifies the number of rows of the JTable. + */ + public void setRowCount(int iRows) { + this.iRows = iRows; + } + + /** + * This method checks if a cell is editable or not. + * @param iRow Specifies the tables row. + * @param iCol Specifies the tables column. + * @return Returns true if the cell is editable. Else, false will be returned. + */ + public boolean isCellEditable(int iRow, int iCol) { + if (iCol > 1) + return true; + + return false; + } + + /** + * Gets a specific table value + * @param iRow Specifies the tables row + * @param iCol Specifies the tables column + * @return Returns the object at (row,column) + */ + public Object getValueAt(int iRow, int iCol) { + CalendarEvent calendarEvent = (CalendarEvent) vecEvents.get(iRow); + + switch (iCol) { + case 0: String sEnum = "" + (iRow + 1); + while (sEnum.length() < iEnumLength) + sEnum = "0" + sEnum; + return sEnum; + case 1: return calendarEvent.getDate(); + case 2: return calendarEvent.getDescription(); + case 3: return calendarEvent.getCategoryName(); + case 4: return calendarEvent.getPlace(); + } + + return "N/A"; + } + + /** + * This function updates the data of the JTable. + * @param object Specifies the new value. + * @param iRow Specifies the row of the cell to be updated. + * @param iCol Specifies the column of the cell to be updated. + */ + public void setValueAt(Object object, int iRow, int iCol) { + CalendarEvent calendarEvent = (CalendarEvent) vecEvents.get(iRow); + + switch (iCol) { + case 2: calendarEvent.setDescription((String) object); + break; + case 3: calendarEvent.setCategoryName((String) object); + break; + case 4: calendarEvent.setPlace((String) object); + break; + default: return; + } + + runLastSorter(); + jTable.updateUI(); + + ClientRequest clientRequest = new ClientRequest(ClientRequest.MODIFY_EVENT); + clientRequest.setEvent(calendarEvent); + ServerRequester.sendClientRequest(clientRequest); + } + + /** + * This method returns the class types of a specific table column. + * @param iCol Specifies the column index to get the class type for. + * @return Returns the class type of the specified column. + */ + public Class getColumnClass(int iCol) { + switch (iCol) { + case 0: return String.class; + case 1: return MyDate.class; + case 2: return String.class; + case 3: return String.class; + case 4: return String.class; + } + + return String.class; + } + + /** + * This method returns the column header of a specific table column. + * @param iCol Specifies the column index to get the column header for. + * @return Returns the header string of the specified column. + */ + public String getColumnName(int iCol) { + switch (iCol) { + case 0: return NUM_HEADER; + case 1: return DATE_HEADER; + case 2: return DESCRIPTION_HEADER; + case 3: return CATEGORY_HEADER; + case 4: return PLACE_HEADER; + } + + return "N/A"; + } + + /** + * This method returns the calendar event which belongs to a specific table row + * @param iRow Specifies the table row index + * @return Returns the calendar event + */ + public CalendarEvent getEvent(int iRow) { + return (CalendarEvent) vecEvents.get(iRow); + } + + /** + * This method updates all the value objects (calendar events) of the table. + * @param vecEvents Specifies the vector of the events to be used. + */ + public void setEvents(Vector vecEvents) { + if (vecEvents == null) + return; + + this.vecEvents = vecEvents; + setRowCount(vecEvents.size()); + + runLastSorter(); + } + + /** + * This method sorts the data again using the last sorting method being used. + */ + private void runLastSorter() { + if (lastSortComparator == null) { + sortByDate(); + + } else { + Collections.sort(vecEvents, lastSortComparator); + jTable.updateUI(); + } + } + + /** + * Sorts the table content by a specified table column. + * @param iCol Specifies the table column to sort against. + */ + public void sortByCol(int iCol) { + switch (iCol) { + case 0: + case 1: sortByDate(); + break; + case 2: sortByDescription(); + break; + case 3: sortByCategory(); + break; + case 4: sortByPlace(); + break; + } + } + + /** + * Reverse sorts the table content by a specified table column. + * @param iCol Specifies the table column to reverse sort against. + */ + public void reverseSortByCol(int iCol) { + switch (iCol) { + case 0: + case 1: reverseSortByDate(); + break; + case 2: reverseSortByDescription(); + break; + case 3: reverseSortByCategory(); + break; + case 4: reverseSortByPlace(); + break; + } + } + + /** + * Sorts the table content by their IDs. + */ + public void sortByID() { + Main.statusMessage("Sorting by ID..."); + + lastSortComparator = new Comparator() { + public int compare(Object objectA, Object objectB) { + int i = ((CalendarEvent) objectA).getID(); + int j = ((CalendarEvent) objectB).getID(); + if (i == j) + return 0; + else if (i < j) + return -1; + else + return 1; + } + public boolean equals(Object object) { return false; } + }; + Collections.sort(vecEvents, lastSortComparator); + jTable.updateUI(); + + Main.statusMessage("Sorting by date done"); + } + + /** + * Sorts the table content by their dates. + */ + public void sortByDate() { + Main.statusMessage("Sorting by date..."); + + lastSortComparator = new Comparator() { + public int compare(Object objectA, Object objectB) { + long l = ((CalendarEvent) objectA).getDate().getTime(); + long m = ((CalendarEvent) objectB).getDate().getTime(); + if (l == m) + return 0; + else if (l < m) + return -1; + else + return 1; + } + public boolean equals(Object object) { return false; } + }; + Collections.sort(vecEvents, lastSortComparator); + jTable.updateUI(); + + Main.statusMessage("Sorting by date done"); + } + + /** + * Sorts the table content by their category names. + */ + public void sortByCategory() { + Main.statusMessage("Sorting by category..."); + lastSortComparator = new Comparator() { + public int compare(Object objectA, Object objectB) { + CalendarEvent eventA = (CalendarEvent) objectA; + CalendarEvent eventB = (CalendarEvent) objectB; + return eventA.getCategoryName().compareTo(eventB.getCategoryName()); + } + public boolean equals(Object object) { return false; } + }; + Collections.sort(vecEvents, lastSortComparator); + jTable.updateUI(); + Main.statusMessage("Sorting by category done"); + } + + /** + * Sorts the table content by their description texts. + */ + public void sortByDescription() { + Main.statusMessage("Sorting by description..."); + lastSortComparator = new Comparator() { + public int compare(Object objectA, Object objectB) { + CalendarEvent eventA = (CalendarEvent) objectA; + CalendarEvent eventB = (CalendarEvent) objectB; + return eventA.getDescription().compareTo(eventB.getDescription()); + } + public boolean equals(Object object) { return false; } + }; + Collections.sort(vecEvents, lastSortComparator); + jTable.updateUI(); + Main.statusMessage("Sorting by description done"); + } + + /** + * Sorts the table content by their places. + */ + public void sortByPlace() { + Main.statusMessage("Sorting by place..."); + lastSortComparator = new Comparator() { + public int compare(Object objectA, Object objectB) { + CalendarEvent eventA = (CalendarEvent) objectA; + CalendarEvent eventB = (CalendarEvent) objectB; + return eventA.getPlace().compareTo(eventB.getPlace()); + } + public boolean equals(Object object) { return false; } + }; + Collections.sort(vecEvents, lastSortComparator); + jTable.updateUI(); + Main.statusMessage("Sorting by place done"); + } + + /** + * Reverse sorts the table content by their IDs. + */ + public void reverseSortByID() { + Main.statusMessage("Reverse sorting by date..."); + lastSortComparator = new Comparator() { + public int compare(Object objectA, Object objectB) { + long i = ((CalendarEvent) objectA).getID(); + long j = ((CalendarEvent) objectB).getID(); + if (i == j) + return 0; + else if (i > j) + return -1; + else + return 1; + } + public boolean equals(Object object) { return false; } + }; + Collections.sort(vecEvents, lastSortComparator); + jTable.updateUI(); + Main.statusMessage("Reverse sorting by date done"); + } + + /** + * Reverse sorts the table content by their dates. + */ + public void reverseSortByDate() { + Main.statusMessage("Reverse sorting by date..."); + lastSortComparator = new Comparator() { + public int compare(Object objectA, Object objectB) { + long l = ((CalendarEvent) objectA).getDate().getTime(); + long m = ((CalendarEvent) objectB).getDate().getTime(); + if (l == m) + return 0; + else if (l > m) + return -1; + else + return 1; + } + public boolean equals(Object object) { return false; } + }; + Collections.sort(vecEvents, lastSortComparator); + jTable.updateUI(); + Main.statusMessage("Reverse sorting by date done"); + } + + /** + * Reverse sorts the table content by their category names. + */ + public void reverseSortByCategory() { + Main.statusMessage("Reverse sorting by category..."); + lastSortComparator = new Comparator() { + public int compare(Object objectA, Object objectB) { + CalendarEvent eventA = (CalendarEvent) objectA; + CalendarEvent eventB = (CalendarEvent) objectB; + return eventB.getCategoryName().compareTo(eventA.getCategoryName()); + } + public boolean equals(Object object) { return false; } + }; + Collections.sort(vecEvents, lastSortComparator); + jTable.updateUI(); + Main.statusMessage("Reverse sorting by category done"); + } + + /** + * Reverse sorts the table content by their description texts. + */ + public void reverseSortByDescription() { + Main.statusMessage("Reverse sorting by description..."); + lastSortComparator = new Comparator() { + public int compare(Object objectA, Object objectB) { + CalendarEvent eventA = (CalendarEvent) objectA; + CalendarEvent eventB = (CalendarEvent) objectB; + return eventB.getDescription().compareTo(eventA.getDescription()); + } + public boolean equals(Object object) { return false; } + }; + Collections.sort(vecEvents, lastSortComparator); + jTable.updateUI(); + Main.statusMessage("Reverse sorting by description done!"); + } + + /** + * Reverse sorts the table content by their places. + */ + public void reverseSortByPlace() { + Main.statusMessage("Reverse sorting by place..."); + lastSortComparator = new Comparator() { + public int compare(Object objectA, Object objectB) { + CalendarEvent eventA = (CalendarEvent) objectA; + CalendarEvent eventB = (CalendarEvent) objectB; + return eventB.getPlace().compareTo(eventA.getPlace()); + } + public boolean equals(Object object) { return false; } + }; + Collections.sort(vecEvents, lastSortComparator); + jTable.updateUI(); + Main.statusMessage("Reverse sorting by place done"); + } +} diff --git a/client/InfoWindow.java b/client/InfoWindow.java new file mode 100644 index 0000000..6b8c32b --- /dev/null +++ b/client/InfoWindow.java @@ -0,0 +1,57 @@ +package client; + +import java.awt.*; +import javax.swing.*; + +/** + * This window simply shows an about message about the + * netcalendar. + * @author paul.buetow + * + */ +public class InfoWindow extends SubWindow { + final static long serialVersionUID = 1L; + private String sText; + + /** + * Creates the window and shows it. + * @param netCalendarClient Specifies the calendar client session object to use. + * @param jTitle Speicifies the title text to be displayd in the title bar. + * @param jText Specifies the text to be displayed at the text area. + */ + public InfoWindow(NetCalendarClient netCalendarClient, String jTitle, String sText) { + super(jTitle, netCalendarClient); + this.sText = sText; + initComponents(); + setResizable(false); + pack(); + setVisible(true); + } + + /** + * This method initializes all the GUI components. + */ + protected void initComponents() { + setSize(306,400); + JPanel contentPane = (JPanel) getContentPane(); + contentPane.setBackground(Color.BLACK); + + // Build the splash screen + JLabel jLabel = new JLabel(new ImageIcon("images/netcal.png")); + contentPane.add(jLabel, BorderLayout.CENTER); + + JTextArea jTextArea = new JTextArea(); + jTextArea.setEditable(false); + jTextArea.setBackground(Color.BLACK); + jTextArea.setForeground(Color.WHITE); + jTextArea.setLineWrap(true); + jTextArea.setWrapStyleWord(true); + jTextArea.setMargin(new Insets(10, 10, 10, 10)); + jTextArea.setText(sText); + jTextArea.setFocusable(false); + jTextArea.setEnabled(false); + JScrollPane jScrollPane = new JScrollPane(jTextArea); + jScrollPane.setPreferredSize(new Dimension(306, 400-261)); + contentPane.add(jScrollPane, BorderLayout.SOUTH); + } +} diff --git a/client/LicenseWindow.java b/client/LicenseWindow.java new file mode 100644 index 0000000..0f683ed --- /dev/null +++ b/client/LicenseWindow.java @@ -0,0 +1,33 @@ +package client; + +import shared.*; + +/** + * This window simply shows an license message. + * @author buetow + * + */ +public class LicenseWindow extends InfoWindow { + final static long serialVersionUID = 1L; + /** + * Creates the window and shows it. + * @param netCalendarClient Specifies the calendar client session object to use. + */ + public LicenseWindow(NetCalendarClient netCalendarClient) { + super(netCalendarClient, "License", + Config.VERSION + "\n" + + "Copyright (C) 2006, 2009 by Paul C. Buetow\n\n" + + "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.\n\n" + + "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.\n\n" + + "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." + ); + } +} diff --git a/client/NetCalendarClient.java b/client/NetCalendarClient.java new file mode 100644 index 0000000..ac5fcda --- /dev/null +++ b/client/NetCalendarClient.java @@ -0,0 +1,731 @@ +/** + */ + +package client; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; +import javax.swing.table.*; +import java.util.*; + +import shared.*; +import shared.remotecall.*; +import client.inputforms.*; + +/** + * This is the main class of the client part of the netcalendar suite. It contains the main GUI. + * All subguis are created within this class. + * @author buetow + */ +public class NetCalendarClient extends JFrame { + private static final long serialVersionUID = 1L; + private static int iNextSession = 1; + private static int iNumCurrentSessions = 0; + private int iCurrentSession; + private NetCalendarClient netCalendarClient; + private Vector vecFrames = new Vector(); + + // Diverse components + private ClientRequest lastClientRequest = null; + protected int iCurrentMouseSelectedRow = 0; + protected int iCurrentMouseSelectedCol = 0; + + // GUI components + private JMenuBar jMenuBar; + private JPopupMenu jPopupMenu; + private CalendarTableModel tableModel; + private JTable jTable; + + private JTextField jTextFieldRegexp; + private JTextField jTextFieldStatusMessages; + + // Some callback objects + private DoCallback doCallbackEditEvent; + private DoCallback doCallbackDeleteEvent; + private DoCallback doCallbackCopyEvent; + private DoCallback doCallbackDeleteCategory; + private DoCallback doCallbackRenameCategory; + + // Static GUI strings which needs to be specified at least twice + private final static String DELETE_EVENT = "Delete event(s)"; + private final static String EDIT_EVENT = "Edit event(s)"; + private final static String COPY_EVENT = "Copy event(s)"; + private final static String CREATE_EVENT = "Create new event"; + private final static String DELETE_CATEGORY = "Delete whole category(s)"; + private final static String RENAME_CATEGORY = "Rename whole category(s)"; + private final static String ADVANCED_SEARCH = "Advanced searching"; + private final static String SORT_BY_COL = "Sort by this row"; + private final static String REVERSE_SORT_BY_COL = "Reverse sort by this row"; + private final static String ENTER_REGEXP_HERE ="Enter some regexp search string here..."; + + /** + * Standard constructor, creates the client GUI. + */ + public NetCalendarClient() { + super(getSessionString(iNextSession) + Config.VERSION); + this.iCurrentSession = iNextSession++; + + // Save a reference of this to allow to access this object through + // inner-classes + // (See the "Advanced searching" action listener object for example!) + this.netCalendarClient = this; + iNumCurrentSessions++; + + initComponents(); + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + setLocationRelativeTo(null); + pack(); + setVisible(true); + + // Start a default request to the netcalendar server + update(new ClientRequest(ClientRequest.REQUEST_ALL_EVENTS)); + } + + /** + * Initializes all the GUI components. + */ + private void initComponents() { + this.addWindowListener(new WindowListener() { + public void windowActivated(WindowEvent e) { } + public void windowClosing(WindowEvent e) {} + public void windowDeactivated(WindowEvent e) {} + public void windowDeiconified(WindowEvent e) {} + public void windowIconified(WindowEvent e) { } + public void windowOpened(WindowEvent e) {} + public void windowClosed(WindowEvent e) { + if (--iNumCurrentSessions == 0) + Main.exit(0); + + Main.infoMessage("Closing a session window"); + } + }); + + Container container = getContentPane(); + + jMenuBar = new JMenuBar(); + setJMenuBar(jMenuBar); + + JMenu jMenuSession = new JMenu("Session"); + jMenuBar.add(jMenuSession); + + JMenuItem jMenuItemNewWindow = new JMenuItem("New window"); + jMenuSession.add(jMenuItemNewWindow); + jMenuItemNewWindow.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + new NetCalendarClient(); + } + }); + + JMenuItem jMenuItemCloseWindow = new JMenuItem("Close window"); + jMenuSession.add(jMenuItemCloseWindow); + jMenuItemCloseWindow.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + dispose(); + } + }); + + jMenuSession.add(new JSeparator()); + + JMenuItem jMenuItemPreferences = new JMenuItem("Preferences"); + jMenuSession.add(jMenuItemPreferences); + jMenuItemPreferences.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + new Preferences(netCalendarClient); + } + }); + + jMenuSession.add(new JSeparator()); + + JMenuItem jMenuItemQuit = new JMenuItem("Quit"); + jMenuSession.add(jMenuItemQuit); + jMenuItemQuit.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + System.exit(0); + } + }); + + JMenu jMenuEdit = new JMenu("Edit"); + jMenuBar.add(jMenuEdit); + + JMenuItem jMenuItemCreate = new JMenuItem(CREATE_EVENT); + jMenuEdit.add(jMenuItemCreate); + jMenuItemCreate.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + new CreateNewEvent(netCalendarClient); + } + }); + + JMenuItem jMenuItemEdit = new JMenuItem(EDIT_EVENT); + jMenuEdit.add(jMenuItemEdit); + doCallbackEditEvent = new DoCallback() { + public void callback(Object obj) { + new EditExistingEvent(netCalendarClient, (CalendarEvent) obj); + } + }; + jMenuItemEdit.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + foreachSelectedEvent(doCallbackEditEvent); + } + }); + + JMenuItem jMenuItemCopy = new JMenuItem(COPY_EVENT); + jMenuEdit.add(jMenuItemCopy); + doCallbackCopyEvent = new DoCallback() { + public void callback(Object obj) { + CalendarEvent calendarEvent = (CalendarEvent) obj; + ClientRequest clientRequest = new ClientRequest(ClientRequest.ADD_EVENT); + clientRequest.setEvent(calendarEvent); + ServerRequester.sendClientRequest(clientRequest); + netCalendarClient.updateLast(); + } + }; + jMenuItemCopy.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + foreachSelectedEvent(doCallbackCopyEvent); + } + }); + + JMenuItem jMenuItemDelete = new JMenuItem(DELETE_EVENT); + jMenuEdit.add(jMenuItemDelete); + doCallbackDeleteEvent = new DoCallback() { + public void callback(Object obj) { + deleteEvent((CalendarEvent)obj); + jTable.getSelectionModel().clearSelection(); + } + }; + jMenuItemDelete.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + foreachSelectedEvent(doCallbackDeleteEvent); + } + }); + + jMenuEdit.add(new JSeparator()); + + JMenuItem jMenuItemRenameCategory = new JMenuItem(RENAME_CATEGORY); + jMenuEdit.add(jMenuItemRenameCategory); + doCallbackRenameCategory = new DoCallback() { + public void callback(Object obj) { + new RenameCategory(netCalendarClient, (CalendarEvent) obj); + jTable.getSelectionModel().clearSelection(); + } + }; + jMenuItemRenameCategory.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + foreachSelectedEvent(doCallbackRenameCategory); + } + }); + + JMenuItem jMenuItemDeleteCategory = new JMenuItem(DELETE_CATEGORY); + jMenuEdit.add(jMenuItemDeleteCategory); + doCallbackDeleteCategory = new DoCallback() { + public void callback(Object obj) { + deleteCategory((CalendarEvent)obj); + jTable.getSelectionModel().clearSelection(); + } + }; + jMenuItemDeleteCategory.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + foreachSelectedEvent(doCallbackDeleteCategory); + } + }); + + + JMenu jMenuSorting = new JMenu("Sorting"); + jMenuBar.add(jMenuSorting); + + JMenuItem jMenuItemSortByDate = new JMenuItem("Sort by date"); + jMenuSorting.add(jMenuItemSortByDate); + jMenuItemSortByDate.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + tableModel.sortByDate(); + } + }); + JMenuItem jMenuItemSortByCategory = new JMenuItem("Sort by category"); + jMenuSorting.add(jMenuItemSortByCategory); + jMenuItemSortByCategory.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + tableModel.sortByCategory(); + } + }); + JMenuItem jMenuItemSortByDescr = new JMenuItem("Sort by description"); + jMenuSorting.add(jMenuItemSortByDescr); + jMenuItemSortByDescr.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + tableModel.sortByDescription(); + } + }); + JMenuItem jMenuItemSortByPlace = new JMenuItem("Sort by place"); + jMenuSorting.add(jMenuItemSortByPlace); + jMenuItemSortByPlace.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + tableModel.sortByPlace(); + } + }); + JMenuItem jMenuItemSortByEventIDs = new JMenuItem("Sort by event IDs"); + jMenuSorting.add(jMenuItemSortByEventIDs); + jMenuItemSortByEventIDs.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + tableModel.sortByID(); + } + }); + + jMenuSorting.add(new JSeparator()); + + JMenuItem jMenuItemReverseSortByDate = new JMenuItem( + "Reverse sort by date"); + jMenuSorting.add(jMenuItemReverseSortByDate); + jMenuItemReverseSortByDate.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + tableModel.reverseSortByDate(); + } + }); + JMenuItem jMenuItemReverseSortByCategory = new JMenuItem( + "Reverse sort by category"); + jMenuSorting.add(jMenuItemReverseSortByCategory); + jMenuItemReverseSortByCategory.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + tableModel.reverseSortByCategory(); + } + }); + JMenuItem jMenuItemReverseSortByDescr = new JMenuItem( + "Reverse sort by description"); + jMenuSorting.add(jMenuItemReverseSortByDescr); + jMenuItemReverseSortByDescr.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + tableModel.reverseSortByDescription(); + } + }); + JMenuItem jMenuItemReverseSortByPlace = new JMenuItem( + "Reverse sort by place"); + jMenuSorting.add(jMenuItemReverseSortByPlace); + jMenuItemReverseSortByPlace.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + tableModel.reverseSortByPlace(); + } + }); + JMenuItem jMenuItemReverseSortByIDs = new JMenuItem( + "Reverse sort by event IDs"); + jMenuSorting.add(jMenuItemReverseSortByIDs); + jMenuItemReverseSortByIDs.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + tableModel.reverseSortByID(); + } + }); + + JMenu jMenuServer = new JMenu("Server"); + jMenuBar.add(jMenuServer); + + JMenuItem jMenuItemUpdate = new JMenuItem("Update events from server"); + jMenuServer.add(jMenuItemUpdate); + jMenuItemUpdate.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + update(lastClientRequest); + } + }); + + JMenuItem jMenuItemGetAll = new JMenuItem("Get all events from server"); + jMenuServer.add(jMenuItemGetAll); + ActionListener actionListenerGetAll = new ActionListener() { + public void actionPerformed(ActionEvent event) { + update(new ClientRequest(ClientRequest.REQUEST_ALL_EVENTS)); + } + }; + jMenuItemGetAll.addActionListener(actionListenerGetAll); + + JMenuItem jMenuItemAdvancedSearch = new JMenuItem( + "Advanced searching for events"); + jMenuServer.add(jMenuItemAdvancedSearch); + jMenuItemAdvancedSearch.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + new AdvancedSearching(netCalendarClient); + } + }); + + jMenuServer.add(new JSeparator()); + + JMenuItem jMenuItemReloadDatabase = new JMenuItem("Reload database"); + jMenuServer.add(jMenuItemReloadDatabase); + jMenuItemReloadDatabase.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + ServerRequester.sendClientRequest(new ClientRequest( + ClientRequest.RELOAD_DATABASE)); + updateLast(); + } + }); + JMenuItem jMenuItemFlushDatabase = new JMenuItem("Flush database"); + jMenuServer.add(jMenuItemFlushDatabase); + jMenuItemFlushDatabase.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + ServerRequester.sendClientRequest(new ClientRequest( + ClientRequest.FLUSH_DATABASE)); + } + }); + + jMenuServer.add(new JSeparator()); + + JMenuItem jMenuItemShutdownServer = new JMenuItem("Shutdown server"); + jMenuServer.add(jMenuItemShutdownServer); + jMenuItemShutdownServer.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + ServerRequester.sendClientRequest(new ClientRequest( + ClientRequest.SHUTDOWN_SERVER)); + } + }); + + JMenu jMenuAbout = new JMenu("About"); + jMenuBar.add(jMenuAbout); + + JMenuItem jMenuItemAbout = new JMenuItem("About"); + jMenuAbout.add(jMenuItemAbout); + jMenuItemAbout.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + new AboutWindow(netCalendarClient); + } + }); + JMenuItem jMenuItemLicense = new JMenuItem("License"); + jMenuAbout.add(jMenuItemLicense); + jMenuItemLicense.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + new LicenseWindow(netCalendarClient); + } + }); + + jPopupMenu = new JPopupMenu(); + ActionListener jPopupMenuActionListener = new ActionListener() { + public void actionPerformed(ActionEvent actionEvent) { + String sActionCommand = actionEvent.getActionCommand(); + if (sActionCommand.equals(DELETE_EVENT)) { + foreachSelectedEvent(doCallbackDeleteEvent); + + } else if (sActionCommand.equals(CREATE_EVENT)) { + new CreateNewEvent(netCalendarClient); + + } else if (sActionCommand.equals(EDIT_EVENT)) { + foreachSelectedEvent(doCallbackEditEvent); + + } else if (sActionCommand.equals(COPY_EVENT)) { + foreachSelectedEvent(doCallbackCopyEvent); + + } else if (sActionCommand.equals(RENAME_CATEGORY)) { + foreachSelectedEvent(doCallbackRenameCategory); + + } else if (sActionCommand.equals(DELETE_CATEGORY)) { + foreachSelectedEvent(doCallbackDeleteCategory); + + } else if (sActionCommand.equals(ADVANCED_SEARCH)) { + new AdvancedSearching(netCalendarClient); + + } else if (sActionCommand.equals(SORT_BY_COL)) { + tableModel.sortByCol(iCurrentMouseSelectedCol); + + } else if (sActionCommand.equals(REVERSE_SORT_BY_COL)) { + tableModel.reverseSortByCol(iCurrentMouseSelectedCol); + } + } + }; + + JMenuItem jMenuItemPopupCreate = new JMenuItem(CREATE_EVENT); + jMenuItemPopupCreate.addActionListener(jPopupMenuActionListener); + jPopupMenu.add(jMenuItemPopupCreate); + JMenuItem jMenuItemPopupEdit = new JMenuItem(EDIT_EVENT); + jMenuItemPopupEdit.addActionListener(jPopupMenuActionListener); + jPopupMenu.add(jMenuItemPopupEdit); + JMenuItem jMenuItemPopupCopy = new JMenuItem(COPY_EVENT); + jMenuItemPopupCopy.addActionListener(jPopupMenuActionListener); + jPopupMenu.add(jMenuItemPopupCopy); + JMenuItem jMenuItemPopupDelete = new JMenuItem(DELETE_EVENT); + jMenuItemPopupDelete.addActionListener(jPopupMenuActionListener); + jPopupMenu.add(jMenuItemPopupDelete); + jPopupMenu.add(new JSeparator()); + + JMenuItem jMenuItemPopupRenameCategory = new JMenuItem(RENAME_CATEGORY); + jMenuItemPopupRenameCategory.addActionListener(jPopupMenuActionListener); + jPopupMenu.add(jMenuItemPopupRenameCategory); + JMenuItem jMenuItemPopupDeleteCategory = new JMenuItem(DELETE_CATEGORY); + jMenuItemPopupDeleteCategory.addActionListener(jPopupMenuActionListener); + jPopupMenu.add(jMenuItemPopupDeleteCategory); + jPopupMenu.add(new JSeparator()); + + JMenuItem jMenuItemPopupSort = new JMenuItem(SORT_BY_COL); + jMenuItemPopupSort.addActionListener(jPopupMenuActionListener); + jPopupMenu.add(jMenuItemPopupSort); + JMenuItem jMenuItemPopupReverseSort = new JMenuItem(REVERSE_SORT_BY_COL); + jMenuItemPopupReverseSort.addActionListener(jPopupMenuActionListener); + jPopupMenu.add(jMenuItemPopupReverseSort); + jPopupMenu.add(new JSeparator()); + + JMenuItem jMenuItemPopupAdvancedSearch = new JMenuItem(ADVANCED_SEARCH); + jMenuItemPopupAdvancedSearch + .addActionListener(jPopupMenuActionListener); + jPopupMenu.add(jMenuItemPopupAdvancedSearch); + + jTable = new JTable(); + jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + + jTable.setColumnModel(new DefaultTableColumnModel() { + private static final long serialVersionUID = 1L; + // Dont allow column moving! + public void moveColumn(int iColumnIndex, int iNewColumnIndex) { } + }); + + tableModel = new CalendarTableModel(jTable); + jTable.setModel(tableModel); + jTable.addMouseListener(new MouseListener() { + public void mouseClicked(MouseEvent mouseEvent) { + iCurrentMouseSelectedRow = jTable.rowAtPoint(mouseEvent.getPoint()); + iCurrentMouseSelectedCol = jTable.columnAtPoint(mouseEvent.getPoint()); + + if (mouseEvent.getButton() != MouseEvent.BUTTON1) + jPopupMenu.show(jTable, mouseEvent.getX(), mouseEvent.getY()); + } + + public void mouseEntered(MouseEvent event) { } + public void mouseExited(MouseEvent event) {} + public void mousePressed(MouseEvent event) { } + public void mouseReleased(MouseEvent event) { + } + }); + + CalendarTableCellRenderer cellRenderer = new CalendarTableCellRenderer(tableModel); + + TableColumn column = jTable.getColumn(CalendarTableModel.NUM_HEADER); + column.setMaxWidth(Config.getStringValue("client_max_events").length() * 10); + column.setResizable(false); + column.setCellRenderer(cellRenderer); + + column = jTable.getColumn(CalendarTableModel.CATEGORY_HEADER); + column.setPreferredWidth(10); + column.setCellRenderer(cellRenderer); + + column = jTable.getColumn(CalendarTableModel.PLACE_HEADER); + column.setPreferredWidth(10); + column.setCellRenderer(cellRenderer); + + jTable.getColumn(CalendarTableModel.DATE_HEADER).setCellRenderer(cellRenderer); + jTable.getColumn(CalendarTableModel.DESCRIPTION_HEADER).setCellRenderer(cellRenderer); + + jTextFieldRegexp = new JTextField(); + jTextFieldRegexp.setText(ENTER_REGEXP_HERE); + jTextFieldRegexp.setEnabled(false); + + ActionListener actionListenerSearchRegexp = new ActionListener() { + public void actionPerformed(ActionEvent event) { + ClientRequest clientRequest = new ClientRequest(); + clientRequest.setRegexpAll(jTextFieldRegexp.getText()); + clientRequest.setMainRegexp(true); + jTextFieldRegexp.setText(""); + update(ServerRequester.sendClientRequest(clientRequest)); + lastClientRequest = clientRequest; + } + }; + MouseListener mouseListenerSearchRegexp = new MouseListener() { + public void mouseClicked(MouseEvent mouseEvent) {} + public void mousePressed(MouseEvent mouseEvent) {} + public void mouseReleased(MouseEvent mouseEvent) {} + public void mouseExited(MouseEvent mouseEvent) { + if (jTextFieldRegexp.getText().equals("")) { + jTextFieldRegexp.setText(ENTER_REGEXP_HERE); + jTextFieldRegexp.setEnabled(false); + } + } + public void mouseEntered(MouseEvent mouseEvent) { + if (!jTextFieldRegexp.isEnabled()) { + jTextFieldRegexp.setText(""); + jTextFieldRegexp.setEnabled(true); + } + } + }; + + jTextFieldRegexp.addActionListener(actionListenerSearchRegexp); + jTextFieldRegexp.addMouseListener(mouseListenerSearchRegexp); + + JButton jButtonSearch = new JButton("Search"); + jButtonSearch.addActionListener(actionListenerSearchRegexp); + jButtonSearch.addMouseListener(mouseListenerSearchRegexp); + + JButton jButtonGetAll = new JButton("Get all"); + jButtonGetAll.addActionListener(actionListenerGetAll); + + // Init split panes + JSplitPane jSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + jSplitPane.setResizeWeight(1); + jSplitPane.setDividerSize(0); + + JSplitPane jSplitPane2 = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + jSplitPane2.setResizeWeight(1); + jSplitPane2.setDividerSize(0); + + JSplitPane jSplitPane3 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); + jSplitPane3.setResizeWeight(1); + jSplitPane3.setDividerSize(0); + + JSplitPane jSplitPane4 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); + jSplitPane4.setDividerSize(0); + + // Init components + JScrollPane jScrollPaneTable = new JScrollPane(jTable); + + jTextFieldStatusMessages = new JTextField("Welcome to " + + Config.VERSION); + jTextFieldStatusMessages.setEditable(false); + + // Set split pane components + jSplitPane.setTopComponent(jScrollPaneTable); + jSplitPane.setBottomComponent(jSplitPane2); + + jSplitPane2.setTopComponent(jSplitPane3); + jSplitPane2.setBottomComponent(jTextFieldStatusMessages); + + JPanel jPanelButtons = new JPanel(); + jPanelButtons.add(jButtonSearch); + jPanelButtons.add(jButtonGetAll); + + jSplitPane3.setLeftComponent(jTextFieldRegexp); + jSplitPane3.setRightComponent(jPanelButtons); + + container.add(jSplitPane); + } + + /** + * This method sends a client request object to the server and used the server response object + * to update the JTable ith its new values using the table model. + * @param clientRequest Specifies the client request object to use for the updating. + */ + public void update(ClientRequest clientRequest) { + if (clientRequest == null) + return; + + update(ServerRequester.sendClientRequest(clientRequest)); + lastClientRequest = clientRequest; + } + + /** + * This method sends the last client request object being used to the server again. If + * If there is no last client request, nothing will be done. + */ + public void updateLast() { + if (lastClientRequest != null) + update(ServerRequester.sendClientRequest(lastClientRequest)); + } + + /** + * This method updates the GUI unsing a given server response object. + * @param serverResponse Specifies the server response to use for the updating. + */ + public void update(ServerResponse serverResponse) { + if (serverResponse == null) + return; + + tableModel.setEvents(serverResponse.getEvents()); + } + + /** + * This method tells the calendar server to delete a given calendar event. + * @param deleteEvent Specifies the calendar event to delete. + */ + public void deleteEvent(CalendarEvent deleteEvent) { + ClientRequest deleteRequest = new ClientRequest( + ClientRequest.DELETE_EVENT); + deleteRequest.setEvent(deleteEvent); + ServerRequester.sendClientRequest(deleteRequest); + updateLast(); + } + + /** + * This method tells the calendar server to delete a given calendar category. + * @param deleteEventsCategory Specifies the calendar event to delete its category! + */ + public void deleteCategory(CalendarEvent deleteEventsCategory) { + ClientRequest deleteRequest = new ClientRequest( + ClientRequest.DELETE_CATEGORY); + deleteRequest.setEvent(deleteEventsCategory); + ServerRequester.sendClientRequest(deleteRequest); + updateLast(); + } + + /** + * If the client has several main windows open, then it will display a + * session indicator so that the user knows which window belongs to which + * session window! + * @param iSession Specifies the session number of the current client window. + * @return Returns the session indicator of the current client session. + */ + private static String getSessionString(int iSession) { + return iSession > 1 ? "[" + iSession + "] " : ""; + } + + /** + * If the client has several main windows open, then it will display a + * session indicator so that the user knows which window belongs to which + * session window. + * @return Returns the session indicator of the current client session. + */ + public String getSessionString() { + return iCurrentSession > 1 ? "[" + iCurrentSession + "] " : ""; + } + + /** + * Runs a callback function on each selected event of the table. + * @param doCallback Specifies the callback object to be used. + */ + public void foreachSelectedEvent(DoCallback doCallback) { + ListSelectionModel listSelectionModel = jTable.getSelectionModel(); + + int iMinIndex = listSelectionModel.getMinSelectionIndex(); + int iMaxIndex = listSelectionModel.getMaxSelectionIndex(); + + Vector vecEvents = new Vector(); + + for (int i = iMinIndex; i <= iMaxIndex; ++i) + if (listSelectionModel.isSelectedIndex(i)) + vecEvents.add(tableModel.getEvent(i)); + + Enumeration enumEvents = vecEvents.elements(); + while (enumEvents.hasMoreElements()) + doCallback.callback(enumEvents.nextElement()); + } + + /** + * This method is for various status messages. All messages will show up in the + * status bar of the current client session window. + * @param sMessage Specifies the message to be displayed in the status bar. + */ + public void statusMessage(String sMessage) { + jTextFieldStatusMessages.setText(sMessage); + jTextFieldStatusMessages.updateUI(); + } + + /** + * This method disposes this JFrame window including all the JFrame windows which + * belong to this session. + */ + public void dispose() { + Enumeration enumFrames = vecFrames.elements(); + + while (enumFrames.hasMoreElements()) + ((JFrame) enumFrames.nextElement()).dispose(); + + super.dispose(); + } + + /** + * This method tells the main netcalendar client JFrame which sub JFrames are opened. + * So that all the sub JFrames will be disposed as well if the main JFrame gets disposed. + * A sub JFrame is for example a input form for advanced searching or the preferences dialog. + * @param jFrame Specifies the frame object to add. . + */ + public void addFrame(JFrame jFrame) { + vecFrames.add(jFrame); + } + + /** + * This method tells the main netcalendar client JFrame which sub JFrames are opened. + * So that all the sub JFrames will be disposed as well if the main JFrame gets disposed. + * A sub JFrame is for example a input form for advanced searching or the preferences dialog. + * @param jFrame Specifies the frame object to remove. + */ + public void removeFrame(JFrame jFrame) { + vecFrames.remove(jFrame); + } +} diff --git a/client/ServerRequester.java b/client/ServerRequester.java new file mode 100644 index 0000000..588d528 --- /dev/null +++ b/client/ServerRequester.java @@ -0,0 +1,82 @@ +/** + * + */ +package client; + + +import java.io.*; +import java.net.*; +import java.security.*; +import javax.net.*; +import javax.net.ssl.*; + +import shared.*; +import shared.remotecall.*; + +/** + * This class only has static members. Its used for creating a client socket to connect and + * communicate with the calendar server. + * @author buetow + */ +public class ServerRequester { + /** + * This method creates a new client socket. + * @return Returns a client socket object. + * @throws IOException + */ + private static Socket makeClientSocket() throws IOException { + if (!Config.getBooleanValue("use_ssl")) { + Main.statusMessage("Making non-SSL Socket..."); + return new Socket(Config.getServerAddress(), Config.getIntValue("server_port")); + } + + Main.statusMessage("Making SSL Socket..."); + //Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + SocketFactory socketFactory = SSLSocketFactory.getDefault(); + return socketFactory.createSocket(Config.getServerAddress(), Config.getIntValue("server_port")); + } + + /** + * Sends a client request to the netcalendar server end receives a server response object. + * @param clientRequest Specifies the client request to send to the calendar server. + * @return Returns the server response. It returns null if no response is available. + */ + public final static ServerResponse sendClientRequest(ClientRequest clientRequest) { + Main.statusMessage("Sending client request to server..."); + + ServerResponse serverResponse = null; + + try { + Socket socket = makeClientSocket(); + socket.setKeepAlive(true); + + // Send the client request to the server + OutputStream outputStream = socket.getOutputStream(); + ObjectOutput objectOutput = new ObjectOutputStream(outputStream); + + objectOutput.writeObject(clientRequest); + objectOutput.flush(); + + // We only want to receive data if the request new events, not if we only send + // changed events! + if (clientRequest.requestsNewEvents()) { + // Recieve the server's response + InputStream inputStream = socket.getInputStream(); + ObjectInput objectInput = new ObjectInputStream(inputStream); + serverResponse = (ServerResponse) objectInput.readObject(); + } + + objectOutput.close(); + socket.close(); + + } catch (Exception e) { + Main.infoMessage("Client error during serialization: " + e.getMessage()); + Main.statusMessage("Error: Client request did not succeed! Server down?"); + return serverResponse; + } + + Main.statusMessage("Last client request succeeded"); + // Returns null if no response is available! + return serverResponse; + } +} diff --git a/client/SplashScreen.java b/client/SplashScreen.java new file mode 100644 index 0000000..5645bae --- /dev/null +++ b/client/SplashScreen.java @@ -0,0 +1,42 @@ +package client; + +import java.awt.*; +import javax.swing.*; +import shared.*; + +public class SplashScreen extends JWindow implements Runnable { + private static final long serialVersionUID = 1L; + + /** + * A simple little method to show a title screen in the center + * of the screen for the amount of time given in the constructor + */ + public void run() { + JPanel jPanel = (JPanel)getContentPane(); + jPanel.setBackground(Color.BLACK); + jPanel.setForeground(Color.WHITE); + + // Set the window's bounds, centering the window + int iWidth = 411; + int iHeight = 261; + Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); + + int x = (dimension.width-iWidth)/2; + int y = (dimension.height-iHeight)/2; + setBounds(x,y,iWidth,iHeight); + + JLabel jLabel = new JLabel(new ImageIcon("images/netcal.png")); + jPanel.add(jLabel, BorderLayout.CENTER); + jPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 3)); + setVisible(true); + + try { + Thread.sleep(3000); + + } catch (Exception e) { + Main.infoMessage(e.getMessage()); + } + + dispose(); + } +} \ No newline at end of file diff --git a/client/SubWindow.java b/client/SubWindow.java new file mode 100644 index 0000000..6ec4872 --- /dev/null +++ b/client/SubWindow.java @@ -0,0 +1,101 @@ +package client; + +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; + +import javax.swing.*; + + +/** + * This is the base class for all subwindows of a main session window of + * the calendar client. + * @author buetow + * + */ +public abstract class SubWindow extends JFrame { + protected final static long serialVersionUID = 1L; + protected NetCalendarClient netCalendarClient; + private SubWindow subWindow; + + /** + * Creates the window and shows it. + * @param sTitleText Specifies the title text of this JFrame. + * @param netCalendarClient Specifies the calendar client session object to use. + */ + public SubWindow(String sTitleText, NetCalendarClient netCalendarClient) { + super(netCalendarClient.getSessionString() + sTitleText); + netCalendarClient.addFrame(this); + this.netCalendarClient = netCalendarClient; + this.subWindow = this; + this.addWindowListener(new MyWindowListener()); + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + setLocationRelativeTo(netCalendarClient); + } + + /** + * Creates the window and shows it. + * @param sTitleText Specifies the title text of this JFrame. + * @param netCalendarClient Specifies the calendar client session object to use. + */ + public void init(String sTitleText, NetCalendarClient netCalendarClient) { + initComponents(); + pack(); + setVisible(true); + } + + /** + * The implemented method should initialize all the GUI components. + */ + protected abstract void initComponents(); + + /** + * This private class is only needed for removing the current JFrame of the outer class + * from the NetCalendarClient object's frame Vector. + * @author buetow + */ + private class MyWindowListener implements WindowListener { + /* + * (non-Javadoc) + * @see java.awt.event.WindowListener#windowClosed(java.awt.event.WindowEvent) + */ + public void windowClosed(WindowEvent e) { + netCalendarClient.removeFrame(subWindow); + } + + /* + * (non-Javadoc) + * @see java.awt.event.WindowListener#windowActivated(java.awt.event.WindowEvent) + */ + public void windowActivated(WindowEvent e) { } + + /* + * (non-Javadoc) + * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent) + */ + public void windowClosing(WindowEvent e) {} + + /* + * (non-Javadoc) + * @see java.awt.event.WindowListener#windowDeactivated(java.awt.event.WindowEvent) + */ + public void windowDeactivated(WindowEvent e) {} + + /* + * (non-Javadoc) + * @see java.awt.event.WindowListener#windowDeiconified(java.awt.event.WindowEvent) + */ + public void windowDeiconified(WindowEvent e) {} + + /* + * (non-Javadoc) + * @see java.awt.event.WindowListener#windowIconified(java.awt.event.WindowEvent) + */ + public void windowIconified(WindowEvent e) { } + + /* + * (non-Javadoc) + * @see java.awt.event.WindowListener#windowOpened(java.awt.event.WindowEvent) + */ + public void windowOpened(WindowEvent e) {} + } +} diff --git a/client/helper/DateSpinner.java b/client/helper/DateSpinner.java new file mode 100644 index 0000000..bae0c9d --- /dev/null +++ b/client/helper/DateSpinner.java @@ -0,0 +1,57 @@ +package client.helper; + + +import java.awt.FlowLayout; +import java.util.Calendar; +import java.util.Date; + +import javax.swing.*; + +/** + * This helper class helps to create a date spinner to edit Date objects. + * @author buetow + */ +public class DateSpinner extends JComponent { + private final static long serialVersionUID = 1L; + private Date date; + private SpinnerDateModel spinnerDateModel; + + /** + * Creates a date spinner to set/edit a given date. This constructor uses the + * current date! + */ + public DateSpinner() { + this.date = new Date(); + initComponents(); + } + + /** + * Creates a date spinner to set/edit a given date. + * @param date The date to be used for the date spinner! + */ + public DateSpinner(Date date) { + this.date = date; + initComponents(); + } + + /** + * Initializes all the date spinner GUI components. + */ + private void initComponents() { + setLayout(new FlowLayout(FlowLayout.LEFT, 4, 4)); + + spinnerDateModel = new SpinnerDateModel(date, null, null, Calendar.MONTH); + JSpinner jSpinner = new JSpinner(spinnerDateModel); + new JSpinner.DateEditor(jSpinner, "MM/yy"); + + add(jSpinner); + } + + /** + * Returns the date which is represented by this spinner. + * @return Returns the date which is represented by this spinner. + */ + public Date getDate() { + return spinnerDateModel.getDate(); + } +} diff --git a/client/helper/GUIHelper.java b/client/helper/GUIHelper.java new file mode 100644 index 0000000..0645304 --- /dev/null +++ b/client/helper/GUIHelper.java @@ -0,0 +1,189 @@ +package client.helper; + +import javax.swing.*; +import javax.swing.SpringLayout; +import java.awt.*; + +import shared.*; + +/** + * This helper class helps to create well arranged GUI components. + * Its creating form- or grid-style layouts using the SpringLayout class. + * @author buetow + */ +public class GUIHelper { + /** + * Aligns the first iRows * iCols + * components of the parent in a grid. Each component is as big as the maximum + * preferred width and height of the components. + * The parent is made just big enough to fit them all. + * @param containerParent Specifies the container to be used + * @param iRows Specifies the number of rows to use. + * @param iCols Specifies the number of columns to use. + * @param iInitialX Specifies the x location to start the grid at. + * @param iInitialY Specifies the y location to start the grid at. + * @param iXPad Specifies the x padding between the cells. + * @param iYPad Specifies the y padding between the cells + */ + public static void makeGrid(Container containerParent, + int iRows, int iCols, + int iInitialX, int iInitialY, + int iXPad, int iYPad) { + SpringLayout helper; + try { + helper = (SpringLayout)containerParent.getLayout(); + } catch (ClassCastException exc) { + Main.infoMessage("Error: The first argument to makeGrid must use SpringLayout."); + return; + } + + Spring iXPadSpring = Spring.constant(iXPad); + Spring iYPadSpring = Spring.constant(iYPad); + Spring iInitialXSpring = Spring.constant(iInitialX); + Spring iInitialYSpring = Spring.constant(iInitialY); + int max = iRows * iCols; + + // Calculate Springs that are the max of the width/height so that all + // cells have the same size. + Spring maxWidthSpring = helper.getConstraints(containerParent.getComponent(0)). + getWidth(); + Spring maxHeightSpring = helper.getConstraints(containerParent.getComponent(0)). + getWidth(); + for (int i = 1; i < max; i++) { + SpringLayout.Constraints cons = helper.getConstraints( + containerParent.getComponent(i)); + + maxWidthSpring = Spring.max(maxWidthSpring, cons.getWidth()); + maxHeightSpring = Spring.max(maxHeightSpring, cons.getHeight()); + } + + // Apply the new width/height Spring. This forces all the + // components to have the same size. + for (int i = 0; i < max; i++) { + SpringLayout.Constraints cons = helper.getConstraints( + containerParent.getComponent(i)); + + cons.setWidth(maxWidthSpring); + cons.setHeight(maxHeightSpring); + } + + // Then adjust the x/y constraints of all the cells so that they + // are aligned in a grid. + SpringLayout.Constraints lastCons = null; + SpringLayout.Constraints lastRowCons = null; + for (int i = 0; i < max; i++) { + SpringLayout.Constraints cons = helper.getConstraints( + containerParent.getComponent(i)); + if (i % iCols == 0) { //start of new iRow + lastRowCons = lastCons; + cons.setX(iInitialXSpring); + } else { //x position depends on previous component + cons.setX(Spring.sum(lastCons.getConstraint(SpringLayout.EAST), + iXPadSpring)); + } + + if (i / iCols == 0) { //first iRow + cons.setY(iInitialYSpring); + } else { //y position depends on previous iRow + cons.setY(Spring.sum(lastRowCons.getConstraint(SpringLayout.SOUTH), + iYPadSpring)); + } + lastCons = cons; + } + + // Set the containerParent's size. + SpringLayout.Constraints pCons = helper.getConstraints(containerParent); + pCons.setConstraint(SpringLayout.SOUTH, + Spring.sum(Spring.constant(iYPad), lastCons.getConstraint(SpringLayout.SOUTH))); + pCons.setConstraint(SpringLayout.EAST, + Spring.sum(Spring.constant(iXPad), lastCons.getConstraint(SpringLayout.EAST))); + } + + /** + * This is a helper method for makeGrid. It returns the constraints for a specific cell. + * @param iRow Specifies the row to get the constraints for. + * @param iCol Specifies the column to get the constraints for. + * @param containerParent Specifies the parent container. + * @param iCols Specifies the number of columns being used. + * @return Returns the constraints object of the current SpringLayout. + */ + private static SpringLayout.Constraints getConstraintsForCell(int iRow, int iCol, + Container containerParent, int iCols) { + + SpringLayout helper = (SpringLayout) containerParent.getLayout(); + Component component = containerParent.getComponent(iRow * iCols + iCol); + return helper.getConstraints(component); + } + + /** + * Aligns the first iRows * iCols + * components of containerParent in + * a grid. Each component in a iColumn is as wide as the maximum + * preferred width of the components in that iColumn; + * height is similarly determined for each iRow. + * The containerParent is made just big enough to fit them all. + * @param iRows Specifies number of rows. + * @param iCols Specifies the number of columns. + * @param iInitialX Specifies the x location to start the grid at. + * @param iInitialY Specifies the y location to start the grid at. + * @param iXPad Specifies the x padding between the cells. + * @param iYPad Specifies the y padding between the cells. + */ + public static void makeCompactGrid(Container containerParent, + int iRows, int iCols, + int iInitialX, int iInitialY, + int iXPad, int iYPad) { + SpringLayout helper; + + try { + helper = (SpringLayout)containerParent.getLayout(); + } catch (ClassCastException exc) { + Main.infoMessage("Error: The first argument to makeCompactGrid must use SpringLayout."); + return; + } + + // Align all cells in each iColumn and make them the same width. + Spring x = Spring.constant(iInitialX); + for (int c = 0; c < iCols; c++) { + Spring width = Spring.constant(0); + for (int r = 0; r < iRows; r++) { + width = Spring.max(width, + getConstraintsForCell(r, c, containerParent, iCols).getWidth()); + } + + for (int r = 0; r < iRows; r++) { + SpringLayout.Constraints constraints = + getConstraintsForCell(r, c, containerParent, iCols); + constraints.setX(x); + constraints.setWidth(width); + } + x = Spring.sum(x, Spring.sum(width, Spring.constant(iXPad))); + } + + // Align all cells in each iRow and make them the same height. + Spring y = Spring.constant(iInitialY); + for (int r = 0; r < iRows; r++) { + Spring height = Spring.constant(0); + + for (int c = 0; c < iCols; c++) { + height = Spring.max(height, + getConstraintsForCell(r, c, containerParent, iCols).getHeight()); + } + + for (int c = 0; c < iCols; c++) { + SpringLayout.Constraints constraints = + getConstraintsForCell(r, c, containerParent, iCols); + + constraints.setY(y); + constraints.setHeight(height); + } + + y = Spring.sum(y, Spring.sum(height, Spring.constant(iYPad))); + } + + // Set the containerParent's size. + SpringLayout.Constraints pCons = helper.getConstraints(containerParent); + pCons.setConstraint(SpringLayout.SOUTH, y); + pCons.setConstraint(SpringLayout.EAST, x); + } +} diff --git a/client/inputforms/AdvancedSearching.java b/client/inputforms/AdvancedSearching.java new file mode 100644 index 0000000..39a8e87 --- /dev/null +++ b/client/inputforms/AdvancedSearching.java @@ -0,0 +1,140 @@ +/* + * A 1.4 application that uses SpringLayout to create a forms-type layout. + * Other files required: SpringUtilities.java. + */ + +package client.inputforms; + +import java.awt.event.*; +import java.util.*; +import javax.swing.*; + +import client.NetCalendarClient; +import client.helper.DateSpinner; +import client.helper.GUIHelper; + + +import shared.remotecall.*; + +/** + * This class contains all the GUI components of the advanced searching dialog. + * Its used for using the andvanced searching options of the client such as using + * Java regular expressions on specific elements of the calendar database instead and + * date ranges. + * @author buetow + * + */ +public class AdvancedSearching extends InputForm { + private final static long serialVersionUID = 1L; + + // Static elements which are the same on all AdvancedSearching objects! + private final static String BUTTON_GET_ALL = "Get all"; + private final static String[] labels = {"Date string: ", "Description: ", "Category: ", "Place: ", + "Use date ranging: ", "Date range from: ", "Date range to: "}; + private final static int iNumPairs = labels.length; + private final static int iTextFields = labels.length - 3; + private final static int iCheckBoxes = labels.length - 2; + + /** + * Create the input form window and show it. + * @param netCalendarClient Specifies the current calendar client session window. + */ + public AdvancedSearching(NetCalendarClient netCalendarClient) { + super("Advanced searching", netCalendarClient); + initComponents(); + pack(); + setVisible(true); + } + + /** + * Initializes all the GUI components. + */ + protected void initComponents() { + super.initComponents(); + //Create and populate the panel. + JPanel jPanel = new JPanel(new SpringLayout()); + + ActionListener actionListenerFields = new ActionListener() { + public void actionPerformed(ActionEvent event) { + submit(); + } + }; + + vecFields = new Vector(); + for (int i = 0; i < iNumPairs; ++i) { + JLabel jLable = new JLabel(labels[i], JLabel.TRAILING); + jPanel.add(jLable); + JComponent jComponent = null; + + if (i < iTextFields) { + JTextField jTextField = new JTextField(InputForm.TEXTFIELD_LENGTH); + jTextField.addActionListener(actionListenerFields); + jComponent = jTextField; + + } else if (i < iCheckBoxes) { + jComponent = new JCheckBox(); + + } else { + jComponent = new DateSpinner(); + } + + jLable.setLabelFor(jComponent); + jPanel.add(jComponent); + + vecFields.add(jComponent); + } + + //Lay out the panel. + GUIHelper.makeCompactGrid(jPanel, + iNumPairs, 2, // iRows, iCols + 6, 6, // iInitX, iInitY + 6, 6); // iXPad, iYPad + + JButton jButtonGetAll = new JButton(BUTTON_GET_ALL); + + ActionListener actionListenerButtons = new ActionListener() { + public void actionPerformed(ActionEvent event) { + if (event.getActionCommand().equals(BUTTON_CLEAR)) + for (int i = 0; i < iTextFields; ++i) + ((JTextField) vecFields.get(i)).setText(""); + + else if (event.getActionCommand().equals(BUTTON_GET_ALL)) + netCalendarClient.update(new ClientRequest(ClientRequest.REQUEST_ALL_EVENTS)); + + } + }; + + jButtonClear.addActionListener(actionListenerButtons); + jButtonGetAll.addActionListener(actionListenerButtons); + jPanelButtons.add(jButtonGetAll); + + JSplitPane jSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + jSplitPane.setTopComponent(jPanel); + jSplitPane.setBottomComponent(jPanelButtons); + jSplitPane.setDividerSize(0); + + setContentPane(jSplitPane); + } + + /** + * This method is invoked if the enter key is pressed or if the submit button + * has been pressed. It starts a client request relating to the user's input of + * the text fields. + */ + protected void submit() { + ClientRequest clientRequest = new ClientRequest(); + clientRequest.setRegexpDate(((JTextField) vecFields.get(0)).getText()); + clientRequest.setRegexpDescription(((JTextField) vecFields.get(1)).getText()); + clientRequest.setRegexpCategory(((JTextField) vecFields.get(2)).getText()); + clientRequest.setRegexpPlace(((JTextField) vecFields.get(3)).getText()); + + JCheckBox jCheckBox = (JCheckBox) vecFields.get(4); + if (jCheckBox.isSelected()) { + Date dateRangeFrom = ((DateSpinner) vecFields.get(5)).getDate(); + Date dateRangeTo = ((DateSpinner) vecFields.get(6)).getDate(); + clientRequest.setDateRange(dateRangeFrom, dateRangeTo); + } + + netCalendarClient.update(clientRequest); + } +} diff --git a/client/inputforms/CreateNewEvent.java b/client/inputforms/CreateNewEvent.java new file mode 100644 index 0000000..5f54e69 --- /dev/null +++ b/client/inputforms/CreateNewEvent.java @@ -0,0 +1,122 @@ +package client.inputforms; + +import java.awt.event.*; +import java.util.*; + +import javax.swing.*; + +import client.NetCalendarClient; +import client.ServerRequester; +import client.helper.DateSpinner; +import client.helper.GUIHelper; + + +import shared.*; +import shared.remotecall.*; + +/** + * This class contains all the GUI components of the create new event dialog. + * Its used for adding new calendar events to the database. + * @author buetow + * + */ +public class CreateNewEvent extends InputForm { + private final static long serialVersionUID = 1L; + + // Static elements which are the same on all AdvancedSearching objects! + private final static String[] labels = + { "Description: ", "Category: ", "Place: ", "Yearly: ", "Date: "}; + private final static int iNumPairs = labels.length; + private final static int iTextFields = iNumPairs - 2; + private final static int iCheckBoxes = iNumPairs - 1; + + /** + * Create the input form window and show it. + * @param netCalendarClient Specifies the current calendar client session window. * + */ + public CreateNewEvent(NetCalendarClient netCalendarClient) { + super("Create new event", netCalendarClient); + initComponents(); + pack(); + setVisible(true); + } + + /** + * Initializes all the GUI components. + */ + protected void initComponents() { + super.initComponents(); + JPanel jPanel = new JPanel(new SpringLayout()); + + ActionListener actionListenerTextFields = new ActionListener() { + public void actionPerformed(ActionEvent event) { + submit(); + } + }; + + vecFields = new Vector(); + for (int i = 0; i < iNumPairs; ++i) { + JLabel jLable = new JLabel(labels[i], JLabel.TRAILING); + jPanel.add(jLable); + JComponent jComponent = null; + if ( i < iTextFields) { + JTextField textField = new JTextField(InputForm.TEXTFIELD_LENGTH); + textField.addActionListener(actionListenerTextFields); + jComponent = textField; + + } else if (i < iCheckBoxes) { + jComponent = new JCheckBox(); + + } else { + jComponent = new DateSpinner(); + } + + jLable.setLabelFor(jComponent); + jPanel.add(jComponent); + vecFields.add(jComponent); + } + + //Lay out the panel. + GUIHelper.makeCompactGrid(jPanel, + iNumPairs, 2, // iRows, iCols + 6, 6, // iInitX, iInitY + 6, 6); // iXPad, iYPad + + ActionListener actionListenerButtons = new ActionListener() { + public void actionPerformed(ActionEvent event) { + if (event.getActionCommand().equals(BUTTON_CLEAR)) + for (int i = 0; i < iNumPairs -2; ++i) + ((JTextField) vecFields.get(i)).setText(""); + } + }; + + jButtonClear.addActionListener(actionListenerButtons); + + JSplitPane jSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + jSplitPane.setTopComponent(jPanel); + jSplitPane.setBottomComponent(jPanelButtons); + jSplitPane.setDividerSize(0); + + setContentPane(jSplitPane); + } + + /** + * This method is invoked if the enter key is pressed or if the submit button + * has been pressed. It starts a client request relating to the user's input of + * the text fields. + */ + protected void submit() { + String sCategoryName = ((JTextField) vecFields.get(1)).getText(); + CalendarEvent calendarEvent = new CalendarEvent(sCategoryName); + calendarEvent.setDescription(((JTextField) vecFields.get(0)).getText()); + calendarEvent.setPlace(((JTextField) vecFields.get(2)).getText()); + calendarEvent.setYearly(((JCheckBox) vecFields.get(3)).isSelected()); + calendarEvent.setDate(((DateSpinner) vecFields.get(4)).getDate()); + + ClientRequest clientRequest = new ClientRequest(ClientRequest.ADD_EVENT); + clientRequest.setEvent(calendarEvent); + + ServerRequester.sendClientRequest(clientRequest); + netCalendarClient.updateLast(); + } +} diff --git a/client/inputforms/EditExistingEvent.java b/client/inputforms/EditExistingEvent.java new file mode 100644 index 0000000..ebb0cc3 --- /dev/null +++ b/client/inputforms/EditExistingEvent.java @@ -0,0 +1,156 @@ +package client.inputforms; + +import java.awt.event.*; +import java.util.*; + +import javax.swing.*; + +import client.NetCalendarClient; +import client.ServerRequester; +import client.helper.DateSpinner; +import client.helper.GUIHelper; + + +import shared.*; +import shared.remotecall.*; + +/** + * This class contains all the GUI components of the edit event dialog. + * Its used for editing existing events of the calendar database. + * @author buetow + * + */ +public class EditExistingEvent extends InputForm { + private final static long serialVersionUID = 1L; + + // Static elements which are the same on all AdvancedSearching objects! + private final static String BUTTON_DELETE = "Delete"; + private final static String[] labels = + { "Event ID: ", "Description: ", "Category: ", "Place: ", "Yearly: ", "Date: "}; + private final static int iNumPairs = labels.length; + private final static int iTextFields = iNumPairs - 2; + private final static int iCheckBoxes = iNumPairs - 1; + + private CalendarEvent originalCalendarEvent; + private Date date; + + /** + * Create the input form window and show it. + * @param netCalendarClient Specifies the current calendar client session window. + * @param originalCalendarEvent Specifies the calendar event to modify. + */ + public EditExistingEvent(NetCalendarClient netCalendarClient, CalendarEvent originalCalendarEvent) { + super("Edit event", netCalendarClient); + this.originalCalendarEvent = originalCalendarEvent; + this.date = originalCalendarEvent.getDate(); + initComponents(); + setFieldValues(); + pack(); + setVisible(true); + } + + /** + * Initializes all the GUI components. + */ + protected void initComponents() { + super.initComponents(); + + JPanel jPanel = new JPanel(new SpringLayout()); + + ActionListener actionListenerTextFields = new ActionListener() { + public void actionPerformed(ActionEvent event) { + submit(); + } + }; + + vecFields = new Vector(); + for (int i = 0; i < iNumPairs; ++i) { + JLabel jLable = new JLabel(labels[i], JLabel.TRAILING); + jPanel.add(jLable); + JComponent jComponent = null; + if ( i < iTextFields) { + JTextField textField = new JTextField(InputForm.TEXTFIELD_LENGTH); + textField.addActionListener(actionListenerTextFields); + jComponent = textField; + + } else if (i < iCheckBoxes) { + jComponent = new JCheckBox(); + + } else { + jComponent = new DateSpinner(date); + } + + jLable.setLabelFor(jComponent); + jPanel.add(jComponent); + vecFields.add(jComponent); + } + + //Lay out the panel. + GUIHelper.makeCompactGrid(jPanel, + iNumPairs, 2, // iRows, iCols + 6, 6, // iInitX, iInitY + 6, 6); // iXPad, iYPad + + JButton jButtonDelete = new JButton(BUTTON_DELETE); + + ActionListener actionListenerButtons = new ActionListener() { + public void actionPerformed(ActionEvent event) { + if (event.getActionCommand().equals(BUTTON_CLEAR)) { + for (int i = 1; i < iNumPairs -2; ++i) + ((JTextField) vecFields.get(i)).setText(""); + + } else if (event.getActionCommand().equals(BUTTON_DELETE)) { + netCalendarClient.deleteEvent(originalCalendarEvent); + dispose(); + } + } + }; + + jButtonDelete.addActionListener(actionListenerButtons); + jButtonClear.addActionListener(actionListenerButtons); + jPanelButtons.add(jButtonDelete); + + JSplitPane jSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + jSplitPane.setTopComponent(jPanel); + jSplitPane.setBottomComponent(jPanelButtons); + jSplitPane.setDividerSize(0); + + setContentPane(jSplitPane); + } + + /** + * This method sets the fields of the edit frame according to the originalCalendarEvent object. + * The date is not set by this method. Its done by the initComponents method. + */ + private void setFieldValues() { + JTextField jTextFieldEventID = (JTextField) vecFields.get(0); + jTextFieldEventID.setText(""+originalCalendarEvent.getEventID()); + jTextFieldEventID.setEditable(false); + + ((JTextField) vecFields.get(1)).setText(originalCalendarEvent.getDescription()); + ((JTextField) vecFields.get(2)).setText(originalCalendarEvent.getCategoryName()); + ((JTextField) vecFields.get(3)).setText(originalCalendarEvent.getPlace()); + ((JCheckBox) vecFields.get(4)).setSelected(originalCalendarEvent.isYearly()); + } + + /** + * This method is invoked if the enter key is pressed or if the submit button + * has been pressed. It starts a client request relating to the user's input of + * the text fields. + */ + protected void submit() { + String sCategoryName = ((JTextField) vecFields.get(2)).getText(); + CalendarEvent calendarEvent = new CalendarEvent(sCategoryName); + calendarEvent.setDescription(((JTextField) vecFields.get(1)).getText()); + calendarEvent.setPlace(((JTextField) vecFields.get(3)).getText()); + calendarEvent.setYearly(((JCheckBox) vecFields.get(4)).isSelected()); + calendarEvent.setDate(((DateSpinner) vecFields.get(5)).getDate()); + calendarEvent.setEventID(originalCalendarEvent.getEventID()); + + ClientRequest clientRequest = new ClientRequest(ClientRequest.MODIFY_EVENT); + clientRequest.setEvent(calendarEvent); + + ServerRequester.sendClientRequest(clientRequest); + netCalendarClient.updateLast(); + } +} diff --git a/client/inputforms/InputForm.java b/client/inputforms/InputForm.java new file mode 100644 index 0000000..75a2dec --- /dev/null +++ b/client/inputforms/InputForm.java @@ -0,0 +1,93 @@ +package client.inputforms; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.*; +import javax.swing.*; + +import client.*; + +/** + * This abstract class is the base class of all other classes of the same package. + * It contains some common members using by all other (specialized) input form classes. + * @author buetow + * + */ +public abstract class InputForm extends SubWindow { + protected final static long serialVersionUID = 1L; + protected Vector vecFields; + protected JPanel jPanelButtons; + protected JButton jButtonClear; + protected JButton jButtonApply; + protected JButton jButtonCancel; + protected JButton jButtonOK; + private boolean bApplyHasBeenPressed = false; + + protected final static String BUTTON_CANCEL = "Cancel"; + protected final static String BUTTON_CLEAR = "Clear"; + protected final static String BUTTON_APPLY = "Apply"; + protected final static String BUTTON_OK = "OK"; + + protected final static int TEXTFIELD_LENGTH = 20; + + /** + * Creates the input form window and show it. + * @param sTitleText Specifies the title text of this JFrame. + * @param netCalendarClient Specifies the calendar client session object to use. + */ + public InputForm(String sTitleText, NetCalendarClient netCalendarClient) { + super(sTitleText, netCalendarClient); + } + + /** + * Initializes the input form + * @param sTitleText Specifies the title text of this JFrame. + * @param netCalendarClient Specifies the calendar client session object to use. + */ + public void init(String sTitleText, NetCalendarClient netCalendarClient) { + super.init(sTitleText, netCalendarClient); + } + + /** + * Initializes all the GUI components of the implementating class. + */ + protected void initComponents() { + jButtonClear = new JButton(BUTTON_CLEAR); + jButtonApply = new JButton(BUTTON_APPLY); + jButtonCancel = new JButton(BUTTON_CANCEL); + jButtonOK = new JButton(BUTTON_OK); + + ActionListener actionListenerButtons = new ActionListener() { + public void actionPerformed(ActionEvent event) { + if (event.getActionCommand().equals(BUTTON_CANCEL)) { + dispose(); + + } else if (event.getActionCommand().equals(BUTTON_APPLY)) { + bApplyHasBeenPressed = true; + submit(); + + } else if (event.getActionCommand().equals(BUTTON_OK)) { + if (!bApplyHasBeenPressed) + submit(); + dispose(); + } + } + }; + + jButtonCancel.addActionListener(actionListenerButtons); + jButtonClear.addActionListener(actionListenerButtons); + jButtonApply.addActionListener(actionListenerButtons); + jButtonOK.addActionListener(actionListenerButtons); + + jPanelButtons = new JPanel(); + jPanelButtons.add(jButtonOK); + jPanelButtons.add(jButtonCancel); + jPanelButtons.add(jButtonApply); + jPanelButtons.add(jButtonClear); + } + + /** + * Submits the input form of the implementating class. + */ + protected abstract void submit(); +} diff --git a/client/inputforms/Preferences.java b/client/inputforms/Preferences.java new file mode 100644 index 0000000..6be32f3 --- /dev/null +++ b/client/inputforms/Preferences.java @@ -0,0 +1,99 @@ +package client.inputforms; + +import java.awt.event.*; +import java.util.*; + +import javax.swing.*; + +import client.NetCalendarClient; +import client.helper.GUIHelper; + + +import shared.*; +/** + * This class contains all the GUI components of the preferences/options/config dialog. + * Its used for editing the current config values of the config.txt file. + * @author buetow + * + */ +public class Preferences extends InputForm { + private final static long serialVersionUID = 1L; + + private String[] labels = null; + private int iNumPairs = -1; + + /** + * Create the input form window and show it. + * @param netCalendarClient Specifies the current calendar client session window. + */ + public Preferences(NetCalendarClient netCalendarClient) { + super("Preferences", netCalendarClient); + initComponents(); + setFieldValues(); + pack(); + setVisible(true); + } + + /** + * Initializes all the GUI components. + */ + protected void initComponents() { + super.initComponents(); + setFieldValues(); + JPanel jPanel = new JPanel(new SpringLayout()); + + labels = Config.getSortedKeyArray(); + iNumPairs = labels.length; + + ActionListener actionListenerTextFields = new ActionListener() { + public void actionPerformed(ActionEvent event) { + submit(); + } + }; + + vecFields = new Vector(); + for (int i = 0; i < iNumPairs; ++i) { + JLabel jLable = new JLabel(labels[i], JLabel.TRAILING); + jPanel.add(jLable); + JTextField textField = new JTextField(InputForm.TEXTFIELD_LENGTH); + textField.addActionListener(actionListenerTextFields); + jLable.setLabelFor(textField); + jPanel.add(textField); + vecFields.add(textField); + } + + //Lay out the panel. + GUIHelper.makeCompactGrid(jPanel, + iNumPairs, 2, // iRows, iCols + 6, 6, // iInitX, iInitY + 6, 6); // iXPad, iYPad + + jPanelButtons.remove(jButtonClear); + JSplitPane jSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + jSplitPane.setTopComponent(jPanel); + jSplitPane.setBottomComponent(jPanelButtons); + jSplitPane.setDividerSize(0); + + setContentPane(jSplitPane); + } + + /** + * This method sets the fields of the edit frame according to the current configuration options. + */ + private void setFieldValues() { + for (int i = 0; i < iNumPairs; ++i) + ((JTextField) vecFields.get(i)).setText(Config.getStringValue(labels[i])); + } + + /** + * This method is invoked if the enter key is pressed or if the submit button + * has been pressed. It starts a client request relating to the user's input of + * the text fields. It will write all changes to the config.txt file. + */ + protected void submit() { + for (int i = 0; i < iNumPairs; ++i) + Config.setValue(labels[i], ((JTextField) vecFields.get(i)).getText()); + + Config.writeConfigToFile(); + } +} diff --git a/client/inputforms/RenameCategory.java b/client/inputforms/RenameCategory.java new file mode 100644 index 0000000..e5e1f29 --- /dev/null +++ b/client/inputforms/RenameCategory.java @@ -0,0 +1,123 @@ +package client.inputforms; + +import java.awt.event.*; +import java.util.*; + +import javax.swing.*; + +import client.NetCalendarClient; +import client.ServerRequester; +import client.helper.DateSpinner; +import client.helper.GUIHelper; + + +import shared.*; +import shared.remotecall.*; + +/** + * This class contains all the GUI components of the edit event dialog. + * Its used for editing existing events of the calendar database. + * @author buetow + * + */ +public class RenameCategory extends InputForm { + private final static long serialVersionUID = 1L; + + // Static elements which are the same on all AdvancedSearching objects! + private final static String[] labels = { "Category name: " }; + private final static int iNumPairs = labels.length; + + private CalendarEvent calendarEvent; + + /** + * Create the input form window and show it. + * @param netCalendarClient Specifies the current calendar client session window. + * @param originalCalendarEvent Specifies the calendar event to modify. + */ + public RenameCategory(NetCalendarClient netCalendarClient, CalendarEvent calendarEvent) { + super("Rename whole category", netCalendarClient); + this.calendarEvent = calendarEvent; + initComponents(); + setFieldValues(); + pack(); + setVisible(true); + } + + /** + * Initializes all the GUI components. + */ + protected void initComponents() { + super.initComponents(); + + JPanel jPanel = new JPanel(new SpringLayout()); + + ActionListener actionListenerTextFields = new ActionListener() { + public void actionPerformed(ActionEvent event) { + submit(); + } + }; + + vecFields = new Vector(); + + for (int i = 0; i < iNumPairs; ++i) { + JLabel jLable = new JLabel(labels[i], JLabel.TRAILING); + jPanel.add(jLable); + JComponent jComponent = null; + JTextField textField = new JTextField(InputForm.TEXTFIELD_LENGTH); + textField.addActionListener(actionListenerTextFields); + jComponent = textField; + jLable.setLabelFor(jComponent); + jPanel.add(jComponent); + vecFields.add(jComponent); + } + + //Lay out the panel. + GUIHelper.makeCompactGrid(jPanel, + iNumPairs, 2, // iRows, iCols + 6, 6, // iInitX, iInitY + 6, 6); // iXPad, iYPad + + ActionListener actionListenerButtons = new ActionListener() { + public void actionPerformed(ActionEvent event) { + if (event.getActionCommand().equals(BUTTON_CLEAR)) { + for (int i = 1; i < iNumPairs; ++i) + ((JTextField) vecFields.get(i)).setText(""); + } + } + }; + + jButtonClear.addActionListener(actionListenerButtons); + jPanelButtons.remove(jButtonClear); + + JSplitPane jSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + jSplitPane.setTopComponent(jPanel); + jSplitPane.setBottomComponent(jPanelButtons); + jSplitPane.setDividerSize(0); + + setContentPane(jSplitPane); + } + + /** + * This method sets the fields of the edit frame according to the originalCalendarEvent object. + * The date is not set by this method. Its done by the initComponents method. + */ + private void setFieldValues() { + ((JTextField) vecFields.get(0)).setText(calendarEvent.getCategoryName()); + } + + /** + * This method is invoked if the enter key is pressed or if the submit button + * has been pressed. It starts a client request relating to the user's input of + * the text fields. + */ + protected void submit() { + String sNewCategoryName = ((JTextField) vecFields.get(0)).getText(); + + ClientRequest clientRequest = new ClientRequest(ClientRequest.RENAME_CATEGORY); + clientRequest.setEvent(calendarEvent); + clientRequest.setString(sNewCategoryName); + ServerRequester.sendClientRequest(clientRequest); + netCalendarClient.updateLast(); + calendarEvent.setCategoryName(sNewCategoryName); + } +} diff --git a/config.txt b/config.txt new file mode 100644 index 0000000..dbc3e3d --- /dev/null +++ b/config.txt @@ -0,0 +1,12 @@ +client_max_events=100; +client_run=true; +logfile=netcalendar.log; +passphrase=dsfiu6786sdfsdhf; +regexp_case_insensitive=true; +server_address=localhost; +server_database_dir=calendardb; +server_port=4321; +server_run=true; +server_startup_command=none; +server_updatedb_command=none; +use_ssl=false; diff --git a/images/netcal.png b/images/netcal.png new file mode 100644 index 0000000..1f76692 Binary files /dev/null and b/images/netcal.png differ diff --git a/javadoc/allclasses-frame.html b/javadoc/allclasses-frame.html new file mode 100644 index 0000000..f9c07a5 --- /dev/null +++ b/javadoc/allclasses-frame.html @@ -0,0 +1,74 @@ + + + + + + +All Classes + + + + + + + + + + +All Classes +
+ + + + + +
AdvancedSearching +
+CalendarCategory +
+CalendarDatabase +
+CalendarEvent +
+CalendarFormatParser +
+CalendarTableCellRenderer +
+CalendarTableModel +
+ClientRequest +
+Config +
+CreateNewEvent +
+DateSpinner +
+EditExistingEvent +
+GUIHelper +
+InputForm +
+Main +
+MyDate +
+MyVector +
+NetCalendarClient +
+NetCalendarServer +
+Preferences +
+RemoteCall +
+ServerRequester +
+ServerResponse +
+
+ + + diff --git a/javadoc/allclasses-noframe.html b/javadoc/allclasses-noframe.html new file mode 100644 index 0000000..f74154f --- /dev/null +++ b/javadoc/allclasses-noframe.html @@ -0,0 +1,74 @@ + + + + + + +All Classes + + + + + + + + + + +All Classes +
+ + + + + +
AdvancedSearching +
+CalendarCategory +
+CalendarDatabase +
+CalendarEvent +
+CalendarFormatParser +
+CalendarTableCellRenderer +
+CalendarTableModel +
+ClientRequest +
+Config +
+CreateNewEvent +
+DateSpinner +
+EditExistingEvent +
+GUIHelper +
+InputForm +
+Main +
+MyDate +
+MyVector +
+NetCalendarClient +
+NetCalendarServer +
+Preferences +
+RemoteCall +
+ServerRequester +
+ServerResponse +
+
+ + + diff --git a/javadoc/client/CalendarTableCellRenderer.html b/javadoc/client/CalendarTableCellRenderer.html new file mode 100644 index 0000000..1742663 --- /dev/null +++ b/javadoc/client/CalendarTableCellRenderer.html @@ -0,0 +1,398 @@ + + + + + + +CalendarTableCellRenderer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +client +
+Class CalendarTableCellRenderer

+
+java.lang.Object
+  extended byjava.awt.Component
+      extended byjava.awt.Container
+          extended byjavax.swing.JComponent
+              extended byjavax.swing.JLabel
+                  extended byjavax.swing.table.DefaultTableCellRenderer
+                      extended byclient.CalendarTableCellRenderer
+
+
+
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.swing.SwingConstants, javax.swing.table.TableCellRenderer
+
+
+
+
public class CalendarTableCellRenderer
extends javax.swing.table.DefaultTableCellRenderer
+ +

+This class is responsible for the rendering of the JTable of the client gui which contains + all the events. +

+ +

+

+
Author:
+
buetow
+
See Also:
Serialized Form
+
+ +

+ + + + + + + +
+Nested Class Summary
+ + + + + + + +
Nested classes inherited from class javax.swing.table.DefaultTableCellRenderer
javax.swing.table.DefaultTableCellRenderer.UIResource
+ + + + + + + +
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
+  + + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
+ + + + + + + +
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
+ + + + + + + +
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
+ + + + + + + +
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
+  + + + + + + + + + + +
+Constructor Summary
CalendarTableCellRenderer(CalendarTableModel tableModel) + +
+          This method creates a custom table cell renderer for the calendar client.
+  + + + + + + + + + + + +
+Method Summary
+ java.awt.ComponentgetTableCellRendererComponent(javax.swing.JTable jTable, + java.lang.Object object, + boolean isSelected, + boolean hasFocus, + int iRow, + int iCol) + +
+          This method returns the Component object of a specific table cell.
+ + + + + + + +
Methods inherited from class javax.swing.table.DefaultTableCellRenderer
firePropertyChange, isOpaque, repaint, repaint, revalidate, setBackground, setForeground, updateUI, validate
+ + + + + + + +
Methods inherited from class javax.swing.JLabel
getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition
+ + + + + + + +
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
+ + + + + + + +
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle
+ + + + + + + +
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+CalendarTableCellRenderer

+
+public CalendarTableCellRenderer(CalendarTableModel tableModel)
+
+
This method creates a custom table cell renderer for the calendar client. + Its coloring the different cells and sets other special display attributes. +

+

Parameters:
tableModel - Specifies the DefaultTableModel object used by the JTable. This is needed to make decisions about displaying a specific cell.
+ + + + + + + + +
+Method Detail
+ +

+getTableCellRendererComponent

+
+public java.awt.Component getTableCellRendererComponent(javax.swing.JTable jTable,
+                                                        java.lang.Object object,
+                                                        boolean isSelected,
+                                                        boolean hasFocus,
+                                                        int iRow,
+                                                        int iCol)
+
+
This method returns the Component object of a specific table cell. +

+

+
Parameters:
jTable - Specifies the table object of the calendar client frame.
object - Specifies the object which is inside of the specific table cell.
isSelected - Specifies if the current cell is selected or not.
hasFocus - Specifies if the current cell is focused or not.
iRow - Specifies thr row number of the current cell.
iCol - specifies the column number of the current cell. +
Returns:
Returns the Component object of a specific table cell.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/CalendarTableModel.html b/javadoc/client/CalendarTableModel.html new file mode 100644 index 0000000..2e6ff3a --- /dev/null +++ b/javadoc/client/CalendarTableModel.html @@ -0,0 +1,777 @@ + + + + + + +CalendarTableModel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +client +
+Class CalendarTableModel

+
+java.lang.Object
+  extended byjavax.swing.table.AbstractTableModel
+      extended byclient.CalendarTableModel
+
+
+
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel
+
+
+
+
public final class CalendarTableModel
extends javax.swing.table.AbstractTableModel
+ +

+This class defined the table model of the JTable of the main calendar client window. All table + data and most of the table actions, like sorting or updating the content, go trough this class. +

+ +

+

+
Author:
+
buetow
+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static java.lang.StringCATEGORY_HEADER + +
+           
+static java.lang.StringDATE_HEADER + +
+           
+static java.lang.StringDESCRIPTION_HEADER + +
+           
+static java.lang.StringPLACE_HEADER + +
+           
+  + + + + + + + + + + +
+Constructor Summary
CalendarTableModel(javax.swing.JTable jTable) + +
+          Simple constructor, creates a calendar table model to be used with the JTable of the netcalendar client main window.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ java.lang.ClassgetColumnClass(int iCol) + +
+          This method returns the class types of a specific table column.
+ intgetColumnCount() + +
+          This method returns the number of columns of the JTable.
+ java.lang.StringgetColumnName(int iCol) + +
+          This method returns the column header of a specific table column.
+ CalendarEventgetEvent(int iRow) + +
+          This method returns the calendar event which belongs to a specific table row
+ intgetRowCount() + +
+          This method retuns the number of rows of the JTable.
+ java.lang.ObjectgetValueAt(int iRow, + int iCol) + +
+          Gets a specific table value
+ booleanisCellEditable(int iRow, + int iCol) + +
+          This method checks if a cell is editable or not.
+ voidreverseSortByCategory() + +
+          Reverse sorts the table content by their category names.
+ voidreverseSortByCol(int iCol) + +
+          Reverse sorts the table content by a specified table column.
+ voidreverseSortByDate() + +
+          Reverse sorts the table content by their dates.
+ voidreverseSortByDescription() + +
+          Reverse sorts the table content by their description texts.
+ voidreverseSortByPlace() + +
+          Reverse sorts the table content by their places.
+ voidsetEvents(java.util.Vector vecEvents) + +
+          This method updates all the value objects (calendar events) of the table.
+ voidsetRowCount(int iRows) + +
+          This method sets the number of rows of the JTable.
+ voidsetValueAt(java.lang.Object object, + int iRow, + int iCol) + +
+          This function updates the data of the JTable.
+ voidsortByCategory() + +
+          Sorts the table content by their category names.
+ voidsortByCol(int iCol) + +
+          Sorts the table content by a specified table column.
+ voidsortByDate() + +
+          Sorts the table content by their dates.
+ voidsortByDescription() + +
+          Sorts the table content by their description texts.
+ voidsortByPlace() + +
+          Sorts the table content by their places.
+ + + + + + + +
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+DATE_HEADER

+
+public static final java.lang.String DATE_HEADER
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CATEGORY_HEADER

+
+public static final java.lang.String CATEGORY_HEADER
+
+
+
See Also:
Constant Field Values
+
+
+ +

+DESCRIPTION_HEADER

+
+public static final java.lang.String DESCRIPTION_HEADER
+
+
+
See Also:
Constant Field Values
+
+
+ +

+PLACE_HEADER

+
+public static final java.lang.String PLACE_HEADER
+
+
+
See Also:
Constant Field Values
+
+ + + + + + + + +
+Constructor Detail
+ +

+CalendarTableModel

+
+public CalendarTableModel(javax.swing.JTable jTable)
+
+
Simple constructor, creates a calendar table model to be used with the JTable of the netcalendar client main window. +

+

Parameters:
jTable - Specifies the JTable object of this table model.
+ + + + + + + + +
+Method Detail
+ +

+getColumnCount

+
+public int getColumnCount()
+
+
This method returns the number of columns of the JTable. +

+

+ +
Returns:
Returns the number of columns of the JTable.
+
+
+
+ +

+getRowCount

+
+public int getRowCount()
+
+
This method retuns the number of rows of the JTable. +

+

+ +
Returns:
Returns the number of rows of the JTable.
+
+
+
+ +

+setRowCount

+
+public void setRowCount(int iRows)
+
+
This method sets the number of rows of the JTable. +

+

+
Parameters:
iRows - Specifies the number of rows of the JTable.
+
+
+
+ +

+isCellEditable

+
+public boolean isCellEditable(int iRow,
+                              int iCol)
+
+
This method checks if a cell is editable or not. +

+

+
Parameters:
iRow - Specifies the tables row.
iCol - Specifies the tables column. +
Returns:
Returns true if the cell is editable. Else, false will be returned.
+
+
+
+ +

+getValueAt

+
+public java.lang.Object getValueAt(int iRow,
+                                   int iCol)
+
+
Gets a specific table value +

+

+
Parameters:
iRow - Specifies the tables row
iCol - Specifies the tables column +
Returns:
Returns the object at (row,column)
+
+
+
+ +

+setValueAt

+
+public void setValueAt(java.lang.Object object,
+                       int iRow,
+                       int iCol)
+
+
This function updates the data of the JTable. +

+

+
Parameters:
object - Specifies the new value.
iRow - Specifies the row of the cell to be updated.
iCol - Specifies the column of the cell to be updated.
+
+
+
+ +

+getColumnClass

+
+public java.lang.Class getColumnClass(int iCol)
+
+
This method returns the class types of a specific table column. +

+

+
Parameters:
iCol - Specifies the column index to get the class type for. +
Returns:
Returns the class type of the specified column.
+
+
+
+ +

+getColumnName

+
+public java.lang.String getColumnName(int iCol)
+
+
This method returns the column header of a specific table column. +

+

+
Parameters:
iCol - Specifies the column index to get the column header for. +
Returns:
Returns the header string of the specified column.
+
+
+
+ +

+getEvent

+
+public CalendarEvent getEvent(int iRow)
+
+
This method returns the calendar event which belongs to a specific table row +

+

+
Parameters:
iRow - Specifies the table row index +
Returns:
Returns the calendar event
+
+
+
+ +

+setEvents

+
+public void setEvents(java.util.Vector vecEvents)
+
+
This method updates all the value objects (calendar events) of the table. +

+

+
Parameters:
vecEvents - Specifies the vector of the events to be used.
+
+
+
+ +

+sortByCol

+
+public void sortByCol(int iCol)
+
+
Sorts the table content by a specified table column. +

+

+
Parameters:
iCol - Specifies the table column to sort against.
+
+
+
+ +

+reverseSortByCol

+
+public void reverseSortByCol(int iCol)
+
+
Reverse sorts the table content by a specified table column. +

+

+
Parameters:
iCol - Specifies the table column to reverse sort against.
+
+
+
+ +

+sortByDate

+
+public void sortByDate()
+
+
Sorts the table content by their dates. +

+

+
+
+
+
+ +

+sortByCategory

+
+public void sortByCategory()
+
+
Sorts the table content by their category names. +

+

+
+
+
+
+ +

+sortByDescription

+
+public void sortByDescription()
+
+
Sorts the table content by their description texts. +

+

+
+
+
+
+ +

+sortByPlace

+
+public void sortByPlace()
+
+
Sorts the table content by their places. +

+

+
+
+
+
+ +

+reverseSortByDate

+
+public void reverseSortByDate()
+
+
Reverse sorts the table content by their dates. +

+

+
+
+
+
+ +

+reverseSortByCategory

+
+public void reverseSortByCategory()
+
+
Reverse sorts the table content by their category names. +

+

+
+
+
+
+ +

+reverseSortByDescription

+
+public void reverseSortByDescription()
+
+
Reverse sorts the table content by their description texts. +

+

+
+
+
+
+ +

+reverseSortByPlace

+
+public void reverseSortByPlace()
+
+
Reverse sorts the table content by their places. +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/NetCalendarClient.html b/javadoc/client/NetCalendarClient.html new file mode 100644 index 0000000..d2e1a27 --- /dev/null +++ b/javadoc/client/NetCalendarClient.html @@ -0,0 +1,562 @@ + + + + + + +NetCalendarClient + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +client +
+Class NetCalendarClient

+
+java.lang.Object
+  extended byjava.awt.Component
+      extended byjava.awt.Container
+          extended byjava.awt.Window
+              extended byjava.awt.Frame
+                  extended byjavax.swing.JFrame
+                      extended byclient.NetCalendarClient
+
+
+
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
+
+
+
+
public class NetCalendarClient
extends javax.swing.JFrame
+ +

+This is the main class of the client part of the netcalendar suite. It contains the main GUI. + All subguis are created within this class. +

+ +

+

+
Author:
+
buetow
+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class javax.swing.JFrame
EXIT_ON_CLOSE
+ + + + + + + +
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
+ + + + + + + +
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
+ + + + + + + +
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
+ + + + + + + +
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
+  + + + + + + + + + + +
+Constructor Summary
NetCalendarClient() + +
+          Standard constructor, creates the client GUI.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidaddFrame(javax.swing.JFrame jFrame) + +
+          This method tells the main netcalendar client JFrame which sub JFrames are opened.
+ voiddeleteEvent(CalendarEvent deleteEvent) + +
+          This method tells the calendar server to delete a given calendar event.
+ voiddispose() + +
+          This method disposes this JFrame window including all the JFrame windows which + belong to this session.
+ java.lang.StringgetSessionString() + +
+          If the client has several main windows open, then it will display a + session indicator so that the user knows which window belongs to which + session window.
+ voidremoveFrame(javax.swing.JFrame jFrame) + +
+          This method tells the main netcalendar client JFrame which sub JFrames are opened.
+ voidstatusMessage(java.lang.String sMessage) + +
+          This method is for various status messages.
+ voidupdate(ClientRequest clientRequest) + +
+          This method sends a client request object to the server and used the server response object + to update the JTable ith its new values using the table model.
+ voidupdate(ServerResponse serverResponse) + +
+          This method updates the GUI unsing a given server response object.
+ voidupdateLast() + +
+          This method sends the last client request object being used to the server again.
+ + + + + + + +
Methods inherited from class javax.swing.JFrame
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update
+ + + + + + + +
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
+ + + + + + + +
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
+ + + + + + + +
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate
+ + + + + + + +
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+ + + + + + + +
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+NetCalendarClient

+
+public NetCalendarClient()
+
+
Standard constructor, creates the client GUI. +

+

+ + + + + + + + +
+Method Detail
+ +

+update

+
+public void update(ClientRequest clientRequest)
+
+
This method sends a client request object to the server and used the server response object + to update the JTable ith its new values using the table model. +

+

+
Parameters:
clientRequest - Specifies the client request object to use for the updating.
+
+
+
+ +

+updateLast

+
+public void updateLast()
+
+
This method sends the last client request object being used to the server again. If + If there is no last client request, nothing will be done. +

+

+
+
+
+
+ +

+update

+
+public void update(ServerResponse serverResponse)
+
+
This method updates the GUI unsing a given server response object. +

+

+
Parameters:
serverResponse - Specifies the server response to use for the updating.
+
+
+
+ +

+deleteEvent

+
+public void deleteEvent(CalendarEvent deleteEvent)
+
+
This method tells the calendar server to delete a given calendar event. +

+

+
Parameters:
deleteEvent - Specifies the calendar event to delete.
+
+
+
+ +

+getSessionString

+
+public java.lang.String getSessionString()
+
+
If the client has several main windows open, then it will display a + session indicator so that the user knows which window belongs to which + session window. +

+

+ +
Returns:
Returns the session indicator of the current client session.
+
+
+
+ +

+statusMessage

+
+public void statusMessage(java.lang.String sMessage)
+
+
This method is for various status messages. All messages will show up in the + status bar of the current client session window. +

+

+
Parameters:
sMessage - Specifies the message to be displayed in the status bar.
+
+
+
+ +

+dispose

+
+public void dispose()
+
+
This method disposes this JFrame window including all the JFrame windows which + belong to this session. +

+

+
+
+
+
+ +

+addFrame

+
+public void addFrame(javax.swing.JFrame jFrame)
+
+
This method tells the main netcalendar client JFrame which sub JFrames are opened. + So that all the sub JFrames will be disposed as well if the main JFrame gets disposed. + A sub JFrame is for example a input form for advanced searching or the preferences dialog. +

+

+
Parameters:
jFrame - Specifies the frame object to add. .
+
+
+
+ +

+removeFrame

+
+public void removeFrame(javax.swing.JFrame jFrame)
+
+
This method tells the main netcalendar client JFrame which sub JFrames are opened. + So that all the sub JFrames will be disposed as well if the main JFrame gets disposed. + A sub JFrame is for example a input form for advanced searching or the preferences dialog. +

+

+
Parameters:
jFrame - Specifies the frame object to remove.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/ServerRequester.html b/javadoc/client/ServerRequester.html new file mode 100644 index 0000000..00784b4 --- /dev/null +++ b/javadoc/client/ServerRequester.html @@ -0,0 +1,264 @@ + + + + + + +ServerRequester + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +client +
+Class ServerRequester

+
+java.lang.Object
+  extended byclient.ServerRequester
+
+
+
+
public class ServerRequester
extends java.lang.Object
+ +

+This class only has static members. Its used for creating a client socket to connect and + communicate with the calendar server. +

+ +

+

+
Author:
+
buetow
+
+
+ +

+ + + + + + + + + + + + + + + + +
+Constructor Summary
ServerRequester() + +
+           
+  + + + + + + + + + + + +
+Method Summary
+static ServerResponsesendClientRequest(ClientRequest clientRequest) + +
+          Sends a client request to the netcalendar server end receives a server response object.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+ServerRequester

+
+public ServerRequester()
+
+
+ + + + + + + + +
+Method Detail
+ +

+sendClientRequest

+
+public static final ServerResponse sendClientRequest(ClientRequest clientRequest)
+
+
Sends a client request to the netcalendar server end receives a server response object. +

+

+
Parameters:
clientRequest - Specifies the client request to send to the calendar server. +
Returns:
Returns the server response. It returns null if no response is available.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/class-use/CalendarTableCellRenderer.html b/javadoc/client/class-use/CalendarTableCellRenderer.html new file mode 100644 index 0000000..154fe89 --- /dev/null +++ b/javadoc/client/class-use/CalendarTableCellRenderer.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Class client.CalendarTableCellRenderer + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
client.CalendarTableCellRenderer

+
+No usage of client.CalendarTableCellRenderer +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/class-use/CalendarTableModel.html b/javadoc/client/class-use/CalendarTableModel.html new file mode 100644 index 0000000..80b2488 --- /dev/null +++ b/javadoc/client/class-use/CalendarTableModel.html @@ -0,0 +1,170 @@ + + + + + + +Uses of Class client.CalendarTableModel + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
client.CalendarTableModel

+
+ + + + + + + + + +
+Packages that use CalendarTableModel
client  
+  +

+ + + + + +
+Uses of CalendarTableModel in client
+  +

+ + + + + + + + +
Constructors in client with parameters of type CalendarTableModel
CalendarTableCellRenderer(CalendarTableModel tableModel) + +
+          This method creates a custom table cell renderer for the calendar client.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/class-use/NetCalendarClient.html b/javadoc/client/class-use/NetCalendarClient.html new file mode 100644 index 0000000..a891fe6 --- /dev/null +++ b/javadoc/client/class-use/NetCalendarClient.html @@ -0,0 +1,196 @@ + + + + + + +Uses of Class client.NetCalendarClient + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
client.NetCalendarClient

+
+ + + + + + + + + +
+Packages that use NetCalendarClient
client.inputforms  
+  +

+ + + + + +
+Uses of NetCalendarClient in client.inputforms
+  +

+ + + + + + + + + + + + + + + + + + + + +
Constructors in client.inputforms with parameters of type NetCalendarClient
Preferences(NetCalendarClient netCalendarClient) + +
+          Create the input form window and show it.
InputForm(java.lang.String sTitleText, + NetCalendarClient netCalendarClient) + +
+          Creates the input form window and show it.
EditExistingEvent(NetCalendarClient netCalendarClient, + CalendarEvent originalCalendarEvent) + +
+          Create the input form window and show it.
CreateNewEvent(NetCalendarClient netCalendarClient) + +
+          Create the input form window and show it.
AdvancedSearching(NetCalendarClient netCalendarClient) + +
+          Create the input form window and show it.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/class-use/ServerRequester.html b/javadoc/client/class-use/ServerRequester.html new file mode 100644 index 0000000..c4070fd --- /dev/null +++ b/javadoc/client/class-use/ServerRequester.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Class client.ServerRequester + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
client.ServerRequester

+
+No usage of client.ServerRequester +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/helper/DateSpinner.html b/javadoc/client/helper/DateSpinner.html new file mode 100644 index 0000000..abdb41f --- /dev/null +++ b/javadoc/client/helper/DateSpinner.html @@ -0,0 +1,365 @@ + + + + + + +DateSpinner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +client.helper +
+Class DateSpinner

+
+java.lang.Object
+  extended byjava.awt.Component
+      extended byjava.awt.Container
+          extended byjavax.swing.JComponent
+              extended byclient.helper.DateSpinner
+
+
+
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
+
+
+
+
public class DateSpinner
extends javax.swing.JComponent
+ +

+This helper class helps to create a date spinner to edit Date objects. +

+ +

+

+
Author:
+
buetow
+
See Also:
Serialized Form
+
+ +

+ + + + + + + +
+Nested Class Summary
+ + + + + + + +
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
+  + + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
+ + + + + + + +
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
+ + + + + + + +
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
+  + + + + + + + + + + + + + +
+Constructor Summary
DateSpinner() + +
+          Creates a date spinner to set/edit a given date.
DateSpinner(java.util.Date date) + +
+          Creates a date spinner to set/edit a given date.
+  + + + + + + + + + + + +
+Method Summary
+ java.util.DategetDate() + +
+          Returns the date which is represented by this spinner.
+ + + + + + + +
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
+ + + + + + + +
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate
+ + + + + + + +
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+DateSpinner

+
+public DateSpinner()
+
+
Creates a date spinner to set/edit a given date. This constructor uses the + current date! +

+

+
+ +

+DateSpinner

+
+public DateSpinner(java.util.Date date)
+
+
Creates a date spinner to set/edit a given date. +

+

Parameters:
date - The date to be used for the date spinner!
+ + + + + + + + +
+Method Detail
+ +

+getDate

+
+public java.util.Date getDate()
+
+
Returns the date which is represented by this spinner. +

+

+ +
Returns:
Returns the date which is represented by this spinner.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/helper/GUIHelper.html b/javadoc/client/helper/GUIHelper.html new file mode 100644 index 0000000..905fa16 --- /dev/null +++ b/javadoc/client/helper/GUIHelper.html @@ -0,0 +1,319 @@ + + + + + + +GUIHelper + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +client.helper +
+Class GUIHelper

+
+java.lang.Object
+  extended byclient.helper.GUIHelper
+
+
+
+
public class GUIHelper
extends java.lang.Object
+ +

+This helper class helps to create well arranged GUI components. + Its creating form- or grid-style layouts using the SpringLayout class. +

+ +

+

+
Author:
+
buetow
+
+
+ +

+ + + + + + + + + + + + + + + + +
+Constructor Summary
GUIHelper() + +
+           
+  + + + + + + + + + + + + + + + +
+Method Summary
+static voidmakeCompactGrid(java.awt.Container containerParent, + int iRows, + int iCols, + int iInitialX, + int iInitialY, + int iXPad, + int iYPad) + +
+          Aligns the first iRows * iCols + components of containerParent in + a grid.
+static voidmakeGrid(java.awt.Container containerParent, + int iRows, + int iCols, + int iInitialX, + int iInitialY, + int iXPad, + int iYPad) + +
+          Aligns the first iRows * iCols + components of the parent in a grid.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+GUIHelper

+
+public GUIHelper()
+
+
+ + + + + + + + +
+Method Detail
+ +

+makeGrid

+
+public static void makeGrid(java.awt.Container containerParent,
+                            int iRows,
+                            int iCols,
+                            int iInitialX,
+                            int iInitialY,
+                            int iXPad,
+                            int iYPad)
+
+
Aligns the first iRows * iCols + components of the parent in a grid. Each component is as big as the maximum + preferred width and height of the components. + The parent is made just big enough to fit them all. +

+

+
Parameters:
containerParent - Specifies the container to be used
iRows - Specifies the number of rows to use.
iCols - Specifies the number of columns to use.
iInitialX - Specifies the x location to start the grid at.
iInitialY - Specifies the y location to start the grid at.
iXPad - Specifies the x padding between the cells.
iYPad - Specifies the y padding between the cells
+
+
+
+ +

+makeCompactGrid

+
+public static void makeCompactGrid(java.awt.Container containerParent,
+                                   int iRows,
+                                   int iCols,
+                                   int iInitialX,
+                                   int iInitialY,
+                                   int iXPad,
+                                   int iYPad)
+
+
Aligns the first iRows * iCols + components of containerParent in + a grid. Each component in a iColumn is as wide as the maximum + preferred width of the components in that iColumn; + height is similarly determined for each iRow. + The containerParent is made just big enough to fit them all. +

+

+
Parameters:
iRows - Specifies number of rows.
iCols - Specifies the number of columns.
iInitialX - Specifies the x location to start the grid at.
iInitialY - Specifies the y location to start the grid at.
iXPad - Specifies the x padding between the cells.
iYPad - Specifies the y padding between the cells.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/helper/class-use/DateSpinner.html b/javadoc/client/helper/class-use/DateSpinner.html new file mode 100644 index 0000000..8e1b3ba --- /dev/null +++ b/javadoc/client/helper/class-use/DateSpinner.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Class client.helper.DateSpinner + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
client.helper.DateSpinner

+
+No usage of client.helper.DateSpinner +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/helper/class-use/GUIHelper.html b/javadoc/client/helper/class-use/GUIHelper.html new file mode 100644 index 0000000..23dbedd --- /dev/null +++ b/javadoc/client/helper/class-use/GUIHelper.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Class client.helper.GUIHelper + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
client.helper.GUIHelper

+
+No usage of client.helper.GUIHelper +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/helper/package-frame.html b/javadoc/client/helper/package-frame.html new file mode 100644 index 0000000..d9ba9da --- /dev/null +++ b/javadoc/client/helper/package-frame.html @@ -0,0 +1,34 @@ + + + + + + +client.helper + + + + + + + + + + + +client.helper + + + + +
+Classes  + +
+DateSpinner +
+GUIHelper
+ + + + diff --git a/javadoc/client/helper/package-summary.html b/javadoc/client/helper/package-summary.html new file mode 100644 index 0000000..fce97ed --- /dev/null +++ b/javadoc/client/helper/package-summary.html @@ -0,0 +1,152 @@ + + + + + + +client.helper + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package client.helper +

+ + + + + + + + + + + + + +
+Class Summary
DateSpinnerThis helper class helps to create a date spinner to edit Date objects.
GUIHelperThis helper class helps to create well arranged GUI components.
+  + +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/helper/package-tree.html b/javadoc/client/helper/package-tree.html new file mode 100644 index 0000000..d7015ea --- /dev/null +++ b/javadoc/client/helper/package-tree.html @@ -0,0 +1,153 @@ + + + + + + +client.helper Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package client.helper +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+
    +
  • class java.lang.Object
      +
    • class java.awt.Component (implements java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable) +
        +
      • class java.awt.Container
          +
        • class javax.swing.JComponent (implements java.io.Serializable) + +
        +
      +
    • class client.helper.GUIHelper
    +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/helper/package-use.html b/javadoc/client/helper/package-use.html new file mode 100644 index 0000000..f5e26c7 --- /dev/null +++ b/javadoc/client/helper/package-use.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Package client.helper + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
client.helper

+
+No usage of client.helper +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/inputforms/AdvancedSearching.html b/javadoc/client/inputforms/AdvancedSearching.html new file mode 100644 index 0000000..f4c8e58 --- /dev/null +++ b/javadoc/client/inputforms/AdvancedSearching.html @@ -0,0 +1,348 @@ + + + + + + +AdvancedSearching + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +client.inputforms +
+Class AdvancedSearching

+
+java.lang.Object
+  extended byjava.awt.Component
+      extended byjava.awt.Container
+          extended byjava.awt.Window
+              extended byjava.awt.Frame
+                  extended byjavax.swing.JFrame
+                      extended byclient.inputforms.InputForm
+                          extended byclient.inputforms.AdvancedSearching
+
+
+
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
+
+
+
+
public class AdvancedSearching
extends InputForm
+ +

+This class contains all the GUI components of the advanced searching dialog. + Its used for using the andvanced searching options of the client such as using + Java regular expressions on specific elements of the calendar database instead and + date ranges. +

+ +

+

+
Author:
+
buetow
+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class javax.swing.JFrame
EXIT_ON_CLOSE
+ + + + + + + +
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
+ + + + + + + +
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
+ + + + + + + +
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
+ + + + + + + +
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
+  + + + + + + + + + + +
+Constructor Summary
AdvancedSearching(NetCalendarClient netCalendarClient) + +
+          Create the input form window and show it.
+  + + + + + + + + + + +
Methods inherited from class javax.swing.JFrame
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update
+ + + + + + + +
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
+ + + + + + + +
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
+ + + + + + + +
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate
+ + + + + + + +
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+ + + + + + + +
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+AdvancedSearching

+
+public AdvancedSearching(NetCalendarClient netCalendarClient)
+
+
Create the input form window and show it. +

+

Parameters:
netCalendarClient - Specifies the current calendar client session window.
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/inputforms/CreateNewEvent.html b/javadoc/client/inputforms/CreateNewEvent.html new file mode 100644 index 0000000..04103b5 --- /dev/null +++ b/javadoc/client/inputforms/CreateNewEvent.html @@ -0,0 +1,346 @@ + + + + + + +CreateNewEvent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +client.inputforms +
+Class CreateNewEvent

+
+java.lang.Object
+  extended byjava.awt.Component
+      extended byjava.awt.Container
+          extended byjava.awt.Window
+              extended byjava.awt.Frame
+                  extended byjavax.swing.JFrame
+                      extended byclient.inputforms.InputForm
+                          extended byclient.inputforms.CreateNewEvent
+
+
+
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
+
+
+
+
public class CreateNewEvent
extends InputForm
+ +

+This class contains all the GUI components of the create new event dialog. + Its used for adding new calendar events to the database. +

+ +

+

+
Author:
+
buetow
+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class javax.swing.JFrame
EXIT_ON_CLOSE
+ + + + + + + +
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
+ + + + + + + +
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
+ + + + + + + +
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
+ + + + + + + +
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
+  + + + + + + + + + + +
+Constructor Summary
CreateNewEvent(NetCalendarClient netCalendarClient) + +
+          Create the input form window and show it.
+  + + + + + + + + + + +
Methods inherited from class javax.swing.JFrame
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update
+ + + + + + + +
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
+ + + + + + + +
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
+ + + + + + + +
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate
+ + + + + + + +
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+ + + + + + + +
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+CreateNewEvent

+
+public CreateNewEvent(NetCalendarClient netCalendarClient)
+
+
Create the input form window and show it. +

+

Parameters:
netCalendarClient - Specifies the current calendar client session window. *
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/inputforms/EditExistingEvent.html b/javadoc/client/inputforms/EditExistingEvent.html new file mode 100644 index 0000000..a00e25b --- /dev/null +++ b/javadoc/client/inputforms/EditExistingEvent.html @@ -0,0 +1,348 @@ + + + + + + +EditExistingEvent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +client.inputforms +
+Class EditExistingEvent

+
+java.lang.Object
+  extended byjava.awt.Component
+      extended byjava.awt.Container
+          extended byjava.awt.Window
+              extended byjava.awt.Frame
+                  extended byjavax.swing.JFrame
+                      extended byclient.inputforms.InputForm
+                          extended byclient.inputforms.EditExistingEvent
+
+
+
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
+
+
+
+
public class EditExistingEvent
extends InputForm
+ +

+This class contains all the GUI components of the edit event dialog. + Its used for editing existing events of the calendar database. +

+ +

+

+
Author:
+
buetow
+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class javax.swing.JFrame
EXIT_ON_CLOSE
+ + + + + + + +
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
+ + + + + + + +
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
+ + + + + + + +
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
+ + + + + + + +
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
+  + + + + + + + + + + +
+Constructor Summary
EditExistingEvent(NetCalendarClient netCalendarClient, + CalendarEvent originalCalendarEvent) + +
+          Create the input form window and show it.
+  + + + + + + + + + + +
Methods inherited from class javax.swing.JFrame
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update
+ + + + + + + +
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
+ + + + + + + +
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
+ + + + + + + +
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate
+ + + + + + + +
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+ + + + + + + +
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+EditExistingEvent

+
+public EditExistingEvent(NetCalendarClient netCalendarClient,
+                         CalendarEvent originalCalendarEvent)
+
+
Create the input form window and show it. +

+

Parameters:
netCalendarClient - Specifies the current calendar client session window.
originalCalendarEvent - Specifies the calendar event to modify.
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/inputforms/InputForm.html b/javadoc/client/inputforms/InputForm.html new file mode 100644 index 0000000..62d21b2 --- /dev/null +++ b/javadoc/client/inputforms/InputForm.html @@ -0,0 +1,350 @@ + + + + + + +InputForm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +client.inputforms +
+Class InputForm

+
+java.lang.Object
+  extended byjava.awt.Component
+      extended byjava.awt.Container
+          extended byjava.awt.Window
+              extended byjava.awt.Frame
+                  extended byjavax.swing.JFrame
+                      extended byclient.inputforms.InputForm
+
+
+
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
+
+
+
Direct Known Subclasses:
AdvancedSearching, CreateNewEvent, EditExistingEvent, Preferences
+
+
+
+
public abstract class InputForm
extends javax.swing.JFrame
+ +

+This abstract class is the base class of all other classes of the same package. + It contains some common members using by all other (specialized) input form classes. +

+ +

+

+
Author:
+
buetow
+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class javax.swing.JFrame
EXIT_ON_CLOSE
+ + + + + + + +
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
+ + + + + + + +
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
+ + + + + + + +
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
+ + + + + + + +
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
+  + + + + + + + + + + +
+Constructor Summary
InputForm(java.lang.String sTitleText, + NetCalendarClient netCalendarClient) + +
+          Creates the input form window and show it.
+  + + + + + + + + + + +
Methods inherited from class javax.swing.JFrame
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update
+ + + + + + + +
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
+ + + + + + + +
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
+ + + + + + + +
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate
+ + + + + + + +
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+ + + + + + + +
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+InputForm

+
+public InputForm(java.lang.String sTitleText,
+                 NetCalendarClient netCalendarClient)
+
+
Creates the input form window and show it. +

+

Parameters:
sTitleText - Specifies the title text of this JFrame.
netCalendarClient - Specifies the calendar client session object to use.
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/inputforms/Preferences.html b/javadoc/client/inputforms/Preferences.html new file mode 100644 index 0000000..aa875f4 --- /dev/null +++ b/javadoc/client/inputforms/Preferences.html @@ -0,0 +1,346 @@ + + + + + + +Preferences + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +client.inputforms +
+Class Preferences

+
+java.lang.Object
+  extended byjava.awt.Component
+      extended byjava.awt.Container
+          extended byjava.awt.Window
+              extended byjava.awt.Frame
+                  extended byjavax.swing.JFrame
+                      extended byclient.inputforms.InputForm
+                          extended byclient.inputforms.Preferences
+
+
+
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
+
+
+
+
public class Preferences
extends InputForm
+ +

+This class contains all the GUI components of the preferences/options/config dialog. + Its used for editing the current config values of the config.txt file. +

+ +

+

+
Author:
+
buetow
+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class javax.swing.JFrame
EXIT_ON_CLOSE
+ + + + + + + +
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
+ + + + + + + +
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
+ + + + + + + +
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
+ + + + + + + +
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
+  + + + + + + + + + + +
+Constructor Summary
Preferences(NetCalendarClient netCalendarClient) + +
+          Create the input form window and show it.
+  + + + + + + + + + + +
Methods inherited from class javax.swing.JFrame
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update
+ + + + + + + +
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
+ + + + + + + +
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
+ + + + + + + +
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate
+ + + + + + + +
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+ + + + + + + +
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+Preferences

+
+public Preferences(NetCalendarClient netCalendarClient)
+
+
Create the input form window and show it. +

+

Parameters:
netCalendarClient - Specifies the current calendar client session window.
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/inputforms/class-use/AdvancedSearching.html b/javadoc/client/inputforms/class-use/AdvancedSearching.html new file mode 100644 index 0000000..344c051 --- /dev/null +++ b/javadoc/client/inputforms/class-use/AdvancedSearching.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Class client.inputforms.AdvancedSearching + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
client.inputforms.AdvancedSearching

+
+No usage of client.inputforms.AdvancedSearching +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/inputforms/class-use/CreateNewEvent.html b/javadoc/client/inputforms/class-use/CreateNewEvent.html new file mode 100644 index 0000000..925a445 --- /dev/null +++ b/javadoc/client/inputforms/class-use/CreateNewEvent.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Class client.inputforms.CreateNewEvent + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
client.inputforms.CreateNewEvent

+
+No usage of client.inputforms.CreateNewEvent +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/inputforms/class-use/EditExistingEvent.html b/javadoc/client/inputforms/class-use/EditExistingEvent.html new file mode 100644 index 0000000..d5553c8 --- /dev/null +++ b/javadoc/client/inputforms/class-use/EditExistingEvent.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Class client.inputforms.EditExistingEvent + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
client.inputforms.EditExistingEvent

+
+No usage of client.inputforms.EditExistingEvent +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/inputforms/class-use/InputForm.html b/javadoc/client/inputforms/class-use/InputForm.html new file mode 100644 index 0000000..baf2fbf --- /dev/null +++ b/javadoc/client/inputforms/class-use/InputForm.html @@ -0,0 +1,196 @@ + + + + + + +Uses of Class client.inputforms.InputForm + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
client.inputforms.InputForm

+
+ + + + + + + + + +
+Packages that use InputForm
client.inputforms  
+  +

+ + + + + +
+Uses of InputForm in client.inputforms
+  +

+ + + + + + + + + + + + + + + + + + + + + +
Subclasses of InputForm in client.inputforms
+ classAdvancedSearching + +
+          This class contains all the GUI components of the advanced searching dialog.
+ classCreateNewEvent + +
+          This class contains all the GUI components of the create new event dialog.
+ classEditExistingEvent + +
+          This class contains all the GUI components of the edit event dialog.
+ classPreferences + +
+          This class contains all the GUI components of the preferences/options/config dialog.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/inputforms/class-use/Preferences.html b/javadoc/client/inputforms/class-use/Preferences.html new file mode 100644 index 0000000..f5d0f4c --- /dev/null +++ b/javadoc/client/inputforms/class-use/Preferences.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Class client.inputforms.Preferences + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
client.inputforms.Preferences

+
+No usage of client.inputforms.Preferences +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/inputforms/package-frame.html b/javadoc/client/inputforms/package-frame.html new file mode 100644 index 0000000..2bb9c45 --- /dev/null +++ b/javadoc/client/inputforms/package-frame.html @@ -0,0 +1,40 @@ + + + + + + +client.inputforms + + + + + + + + + + + +client.inputforms + + + + +
+Classes  + +
+AdvancedSearching +
+CreateNewEvent +
+EditExistingEvent +
+InputForm +
+Preferences
+ + + + diff --git a/javadoc/client/inputforms/package-summary.html b/javadoc/client/inputforms/package-summary.html new file mode 100644 index 0000000..279f862 --- /dev/null +++ b/javadoc/client/inputforms/package-summary.html @@ -0,0 +1,164 @@ + + + + + + +client.inputforms + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package client.inputforms +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+Class Summary
AdvancedSearchingThis class contains all the GUI components of the advanced searching dialog.
CreateNewEventThis class contains all the GUI components of the create new event dialog.
EditExistingEventThis class contains all the GUI components of the edit event dialog.
InputFormThis abstract class is the base class of all other classes of the same package.
PreferencesThis class contains all the GUI components of the preferences/options/config dialog.
+  + +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/inputforms/package-tree.html b/javadoc/client/inputforms/package-tree.html new file mode 100644 index 0000000..201c25b --- /dev/null +++ b/javadoc/client/inputforms/package-tree.html @@ -0,0 +1,161 @@ + + + + + + +client.inputforms Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package client.inputforms +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+
    +
  • class java.lang.Object
      +
    • class java.awt.Component (implements java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable) +
        +
      • class java.awt.Container
          +
        • class java.awt.Window (implements javax.accessibility.Accessible) +
            +
          • class java.awt.Frame (implements java.awt.MenuContainer) + +
          +
        +
      +
    +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/inputforms/package-use.html b/javadoc/client/inputforms/package-use.html new file mode 100644 index 0000000..532eba3 --- /dev/null +++ b/javadoc/client/inputforms/package-use.html @@ -0,0 +1,162 @@ + + + + + + +Uses of Package client.inputforms + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
client.inputforms

+
+ + + + + + + + + +
+Packages that use client.inputforms
client.inputforms  
+  +

+ + + + + + + + +
+Classes in client.inputforms used by client.inputforms
InputForm + +
+          This abstract class is the base class of all other classes of the same package.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/package-frame.html b/javadoc/client/package-frame.html new file mode 100644 index 0000000..6672657 --- /dev/null +++ b/javadoc/client/package-frame.html @@ -0,0 +1,38 @@ + + + + + + +client + + + + + + + + + + + +client + + + + +
+Classes  + +
+CalendarTableCellRenderer +
+CalendarTableModel +
+NetCalendarClient +
+ServerRequester
+ + + + diff --git a/javadoc/client/package-summary.html b/javadoc/client/package-summary.html new file mode 100644 index 0000000..60db648 --- /dev/null +++ b/javadoc/client/package-summary.html @@ -0,0 +1,161 @@ + + + + + + +client + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package client +

+ + + + + + + + + + + + + + + + + + + + + +
+Class Summary
CalendarTableCellRendererThis class is responsible for the rendering of the JTable of the client gui which contains + all the events.
CalendarTableModelThis class defined the table model of the JTable of the main calendar client window.
NetCalendarClientThis is the main class of the client part of the netcalendar suite.
ServerRequesterThis class only has static members.
+  + +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/package-tree.html b/javadoc/client/package-tree.html new file mode 100644 index 0000000..1221b16 --- /dev/null +++ b/javadoc/client/package-tree.html @@ -0,0 +1,171 @@ + + + + + + +client Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package client +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+
    +
  • class java.lang.Object
      +
    • class javax.swing.table.AbstractTableModel (implements java.io.Serializable, javax.swing.table.TableModel) + +
    • class java.awt.Component (implements java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable) +
        +
      • class java.awt.Container
          +
        • class javax.swing.JComponent (implements java.io.Serializable) +
            +
          • class javax.swing.JLabel (implements javax.accessibility.Accessible, javax.swing.SwingConstants) +
              +
            • class javax.swing.table.DefaultTableCellRenderer (implements java.io.Serializable, javax.swing.table.TableCellRenderer) + +
            +
          +
        • class java.awt.Window (implements javax.accessibility.Accessible) +
            +
          • class java.awt.Frame (implements java.awt.MenuContainer) +
              +
            • class javax.swing.JFrame (implements javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants) + +
            +
          +
        +
      +
    • class client.ServerRequester
    +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/client/package-use.html b/javadoc/client/package-use.html new file mode 100644 index 0000000..9223fe8 --- /dev/null +++ b/javadoc/client/package-use.html @@ -0,0 +1,181 @@ + + + + + + +Uses of Package client + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
client

+
+ + + + + + + + + + + + + +
+Packages that use client
client  
client.inputforms  
+  +

+ + + + + + + + +
+Classes in client used by client
CalendarTableModel + +
+          This class defined the table model of the JTable of the main calendar client window.
+  +

+ + + + + + + + +
+Classes in client used by client.inputforms
NetCalendarClient + +
+          This is the main class of the client part of the netcalendar suite.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/constant-values.html b/javadoc/constant-values.html new file mode 100644 index 0000000..1829745 --- /dev/null +++ b/javadoc/constant-values.html @@ -0,0 +1,272 @@ + + + + + + +Constant Field Values + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Constant Field Values

+
+
+Contents + + + + + + +
+client.*
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
client.CalendarTableModel
+public static final java.lang.StringCATEGORY_HEADER"Category"
+public static final java.lang.StringDATE_HEADER"Date"
+public static final java.lang.StringDESCRIPTION_HEADER"Description"
+public static final java.lang.StringPLACE_HEADER"Place"
+ +

+ +

+ + + + + +
+shared.*
+ +

+ + + + + + + + + + + + +
shared.Config
+public static final java.lang.StringVERSION"NetCalendar 1.0 RC 2"
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
shared.remotecall.ClientRequest
+public static final intADD_EVENT4
+public static final intDELETE_EVENT3
+public static final intFLUSH_DATABASE6
+public static final intMODIFY_EVENT2
+public static final intRELOAD_DATABASE5
+public static final intREQUEST_ALL_EVENTS1
+public static final intREQUEST_EVENTS0
+public static final intSHUTDOWN_SERVER7
+ +

+ +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/deprecated-list.html b/javadoc/deprecated-list.html new file mode 100644 index 0000000..ade60f9 --- /dev/null +++ b/javadoc/deprecated-list.html @@ -0,0 +1,134 @@ + + + + + + +Deprecated List + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Deprecated API

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/help-doc.html b/javadoc/help-doc.html new file mode 100644 index 0000000..a3e2499 --- /dev/null +++ b/javadoc/help-doc.html @@ -0,0 +1,193 @@ + + + + + + +API Help + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+How This API Document Is Organized

+
+This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

+Overview

+
+ +

+The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

+

+Package

+
+ +

+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    +
  • Interfaces (italic)
  • Classes
  • Exceptions
  • Errors
+
+

+Class/Interface

+
+ +

+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description +

    +

  • Nested Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary +

    +

  • Field Detail
  • Constructor Detail
  • Method Detail
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+

+Use

+
+Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
+

+Tree (Class Hierarchy)

+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    +
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+

+Deprecated API

+
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+

+Index

+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+

+Prev/Next

+These links take you to the next or previous class, interface, package, or related page.

+Frames/No Frames

+These links show and hide the HTML frames. All pages are available with or without frames. +

+

+Serialized Form

+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +

+ + +This help file applies to API documentation generated using the standard doclet. + +
+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/index-files/index-1.html b/javadoc/index-files/index-1.html new file mode 100644 index 0000000..036e1d7 --- /dev/null +++ b/javadoc/index-files/index-1.html @@ -0,0 +1,158 @@ + + + + + + +A-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+A

+
+
ADD_EVENT - +Static variable in class shared.remotecall.ClientRequest +
  +
AdvancedSearching - class client.inputforms.AdvancedSearching.
This class contains all the GUI components of the advanced searching dialog.
AdvancedSearching(NetCalendarClient) - +Constructor for class client.inputforms.AdvancedSearching +
Create the input form window and show it. +
actionIs(int) - +Method in class shared.remotecall.ClientRequest +
This method is needed by the clanedar server to get the type of action requested. +
addEvent(ClientRequest) - +Method in class server.CalendarDatabase +
This method adds a calendar event to the calendar database. +
addEvent(CalendarEvent) - +Method in class shared.CalendarCategory +
This method adds an event to the category. +
addFrame(JFrame) - +Method in class client.NetCalendarClient +
This method tells the main netcalendar client JFrame which sub JFrames are opened. +
addZerosToFront(int, int) - +Static method in class shared.MyDate +
This method adds zeros in front of a number and returns it as a string. +
appendVector(Vector) - +Method in class shared.MyVector +
This method appends a vector at the end. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-10.html b/javadoc/index-files/index-10.html new file mode 100644 index 0000000..e4ed4be --- /dev/null +++ b/javadoc/index-files/index-10.html @@ -0,0 +1,140 @@ + + + + + + +N-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+N

+
+
NetCalendarClient - class client.NetCalendarClient.
This is the main class of the client part of the netcalendar suite.
NetCalendarClient() - +Constructor for class client.NetCalendarClient +
Standard constructor, creates the client GUI. +
NetCalendarServer - class server.NetCalendarServer.
This is the main class of the server part of the netcalendar suite.
NetCalendarServer(int, String) - +Constructor for class server.NetCalendarServer +
Creates a NetCalendarServer instance and runs it as a thread. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-11.html b/javadoc/index-files/index-11.html new file mode 100644 index 0000000..2c980c6 --- /dev/null +++ b/javadoc/index-files/index-11.html @@ -0,0 +1,140 @@ + + + + + + +P-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+P

+
+
PLACE_HEADER - +Static variable in class client.CalendarTableModel +
  +
Preferences - class client.inputforms.Preferences.
This class contains all the GUI components of the preferences/options/config dialog.
Preferences(NetCalendarClient) - +Constructor for class client.inputforms.Preferences +
Create the input form window and show it. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-12.html b/javadoc/index-files/index-12.html new file mode 100644 index 0000000..8b8e443 --- /dev/null +++ b/javadoc/index-files/index-12.html @@ -0,0 +1,180 @@ + + + + + + +R-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+R

+
+
RELOAD_DATABASE - +Static variable in class shared.remotecall.ClientRequest +
  +
REQUEST_ALL_EVENTS - +Static variable in class shared.remotecall.ClientRequest +
  +
REQUEST_EVENTS - +Static variable in class shared.remotecall.ClientRequest +
  +
RemoteCall - class shared.remotecall.RemoteCall.
This is the abstract base class of all other classes of the shared.remotecall package.
RemoteCall() - +Constructor for class shared.remotecall.RemoteCall +
  +
readConfig(String) - +Static method in class shared.Config +
This methods reads the options from the calendar config file 'config.txt'. +
removeEvent(CalendarEvent) - +Method in class shared.CalendarCategory +
This method removes a given event from its event vector. +
removeFrame(JFrame) - +Method in class client.NetCalendarClient +
This method tells the main netcalendar client JFrame which sub JFrames are opened. +
removeFromCurrentCategory() - +Method in class shared.CalendarEvent +
Removes the calendar event from its current category and sets the + category reference to null. +
requestsNewEvents() - +Method in class shared.remotecall.ClientRequest +
This method is needed by the calendar server to get the type of action requested. +
reverseSortByCategory() - +Method in class client.CalendarTableModel +
Reverse sorts the table content by their category names. +
reverseSortByCol(int) - +Method in class client.CalendarTableModel +
Reverse sorts the table content by a specified table column. +
reverseSortByDate() - +Method in class client.CalendarTableModel +
Reverse sorts the table content by their dates. +
reverseSortByDescription() - +Method in class client.CalendarTableModel +
Reverse sorts the table content by their description texts. +
reverseSortByPlace() - +Method in class client.CalendarTableModel +
Reverse sorts the table content by their places. +
run() - +Method in class server.NetCalendarServer +
This method specifies the start method of the Thread. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-13.html b/javadoc/index-files/index-13.html new file mode 100644 index 0000000..be4ff77 --- /dev/null +++ b/javadoc/index-files/index-13.html @@ -0,0 +1,239 @@ + + + + + + +S-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+S

+
+
SHUTDOWN_SERVER - +Static variable in class shared.remotecall.ClientRequest +
  +
ServerRequester - class client.ServerRequester.
This class only has static members.
ServerRequester() - +Constructor for class client.ServerRequester +
  +
ServerResponse - class shared.remotecall.ServerResponse.
This class represents a server response.
ServerResponse(Vector) - +Constructor for class shared.remotecall.ServerResponse +
Simple constructor, creates a server response which can be sent to the calendar client. +
sendClientRequest(ClientRequest) - +Static method in class client.ServerRequester +
Sends a client request to the netcalendar server end receives a server response object. +
server - package server
 
setCategory(CalendarCategory) - +Method in class shared.CalendarEvent +
This method sets the event's category. +
setCategoryName(String) - +Method in class shared.CalendarEvent +
This methos sets thhe event's category name. +
setDate(Date) - +Method in class shared.CalendarEvent +
This method sets the event's date. +
setDateRange(Date, Date) - +Method in class shared.remotecall.ClientRequest +
This method sets the date range to request. +
setDescription(String) - +Method in class shared.CalendarEvent +
This method sets the event's descriptions tring. +
setEvent(CalendarEvent) - +Method in class shared.remotecall.ClientRequest +
This method sets a calendar event object to be transfered to the calendar server because the event has been modified. +
setEventID(int) - +Method in class shared.CalendarEvent +
This method sets the event's ID number. +
setEvents(Vector) - +Method in class client.CalendarTableModel +
This method updates all the value objects (calendar events) of the table. +
setEvents(Vector) - +Method in class shared.CalendarCategory +
This method sets the categorie's initial events. +
setHasChanged(boolean) - +Method in class shared.CalendarCategory +
This method specifies if the calendar category has been modified/changed or not. +
setMainRegexp(boolean) - +Method in class shared.remotecall.ClientRequest +
This method sets if the client contains a regexp from the main session window. +
setNumEventsToRequest(int) - +Method in class shared.remotecall.ClientRequest +
With this method the client can define the maximum number of events to request. +
setPlace(String) - +Method in class shared.CalendarEvent +
This method sets the event's place string. +
setRegexpAll(String) - +Method in class shared.remotecall.ClientRequest +
This method compiles a specific pattern object to match with on the server part after serialization. +
setRegexpCategory(String) - +Method in class shared.remotecall.ClientRequest +
This method compiles a specific pattern object to match with on the server part after serialization. +
setRegexpDate(String) - +Method in class shared.remotecall.ClientRequest +
This method compiles a specific pattern object to match with on the server part after serialization. +
setRegexpDescription(String) - +Method in class shared.remotecall.ClientRequest +
This method compiles a specific pattern object to match with on the server part after serialization. +
setRegexpPlace(String) - +Method in class shared.remotecall.ClientRequest +
This method compiles a specific pattern object to match with on the server part after serialization. +
setRowCount(int) - +Method in class client.CalendarTableModel +
This method sets the number of rows of the JTable. +
setValue(String, String) - +Static method in class shared.Config +
This method changes or adds a specific config value. +
setValueAt(Object, int, int) - +Method in class client.CalendarTableModel +
This function updates the data of the JTable. +
setWorkdir(String) - +Method in class server.CalendarFormatParser +
This method sets the working directory. +
setYearly(boolean) - +Method in class shared.CalendarEvent +
This method specifies if this event occurs yearly or not. +
shared - package shared
 
shared.remotecall - package shared.remotecall
 
sortByCategory() - +Method in class client.CalendarTableModel +
Sorts the table content by their category names. +
sortByCol(int) - +Method in class client.CalendarTableModel +
Sorts the table content by a specified table column. +
sortByDate() - +Method in class client.CalendarTableModel +
Sorts the table content by their dates. +
sortByDescription() - +Method in class client.CalendarTableModel +
Sorts the table content by their description texts. +
sortByPlace() - +Method in class client.CalendarTableModel +
Sorts the table content by their places. +
start() - +Method in class server.CalendarFormatParser +
Starts the parsing work of the calendar database files. +
statusMessage(String) - +Method in class client.NetCalendarClient +
This method is for various status messages. +
statusMessage(String) - +Static method in class shared.Main +
This method is for various messages. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-14.html b/javadoc/index-files/index-14.html new file mode 100644 index 0000000..13b27bf --- /dev/null +++ b/javadoc/index-files/index-14.html @@ -0,0 +1,143 @@ + + + + + + +T-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+T

+
+
toString() - +Method in class shared.CalendarEvent +
This method is needed for a text representation of the object. +
toString() - +Method in class shared.MyDate +
  +
toString() - +Method in class shared.remotecall.ClientRequest +
This method returns a representation the object as a string. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-15.html b/javadoc/index-files/index-15.html new file mode 100644 index 0000000..3003cad --- /dev/null +++ b/javadoc/index-files/index-15.html @@ -0,0 +1,147 @@ + + + + + + +U-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+U

+
+
unsetFile() - +Method in class shared.CalendarCategory +
This method Sets the categories file handle to null. +
update(ClientRequest) - +Method in class client.NetCalendarClient +
This method sends a client request object to the server and used the server response object + to update the JTable ith its new values using the table model. +
update(ServerResponse) - +Method in class client.NetCalendarClient +
This method updates the GUI unsing a given server response object. +
updateLast() - +Method in class client.NetCalendarClient +
This method sends the last client request object being used to the server again. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-16.html b/javadoc/index-files/index-16.html new file mode 100644 index 0000000..73ed478 --- /dev/null +++ b/javadoc/index-files/index-16.html @@ -0,0 +1,137 @@ + + + + + + +V-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+V

+
+
VERSION - +Static variable in class shared.Config +
  +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-17.html b/javadoc/index-files/index-17.html new file mode 100644 index 0000000..028b35d --- /dev/null +++ b/javadoc/index-files/index-17.html @@ -0,0 +1,137 @@ + + + + + + +W-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+W

+
+
writeConfigToFile() - +Static method in class shared.Config +
This method writes the current configuration to the config file "config.txt". +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-2.html b/javadoc/index-files/index-2.html new file mode 100644 index 0000000..b182c97 --- /dev/null +++ b/javadoc/index-files/index-2.html @@ -0,0 +1,178 @@ + + + + + + +C-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+C

+
+
CATEGORY_HEADER - +Static variable in class client.CalendarTableModel +
  +
CalendarCategory - class shared.CalendarCategory.
This class specifies a category of the calendar events.
CalendarCategory(File) - +Constructor for class shared.CalendarCategory +
Creates a new calendar category object and sets the categorie's name to the filename of the category. +
CalendarCategory(String) - +Constructor for class shared.CalendarCategory +
Creates a new calendar category object and sets the categorie's File to the name of the category. +
CalendarDatabase - class server.CalendarDatabase.
A object of this class encapsulates the whole calendar database on the server side.
CalendarDatabase(Vector) - +Constructor for class server.CalendarDatabase +
Simple constructur. +
CalendarEvent - class shared.CalendarEvent.
This class specifies calendar events.
CalendarEvent(CalendarCategory) - +Constructor for class shared.CalendarEvent +
Simple constructor, creates an event object and increments iEventIDCount by one. +
CalendarEvent(String) - +Constructor for class shared.CalendarEvent +
Simple constructor, creates an event object and increments iEventIDCount by one. +
CalendarFormatParser - class server.CalendarFormatParser.
This class is needed for parsing the original UNIX calendar database format.
CalendarFormatParser() - +Constructor for class server.CalendarFormatParser +
Simple constructor. +
CalendarTableCellRenderer - class client.CalendarTableCellRenderer.
This class is responsible for the rendering of the JTable of the client gui which contains + all the events.
CalendarTableCellRenderer(CalendarTableModel) - +Constructor for class client.CalendarTableCellRenderer +
This method creates a custom table cell renderer for the calendar client. +
CalendarTableModel - class client.CalendarTableModel.
This class defined the table model of the JTable of the main calendar client window.
CalendarTableModel(JTable) - +Constructor for class client.CalendarTableModel +
Simple constructor, creates a calendar table model to be used with the JTable of the netcalendar client main window. +
ClientRequest - class shared.remotecall.ClientRequest.
An object of this class is sent from the calendar client to the calendar server each time + a request is made.
ClientRequest() - +Constructor for class shared.remotecall.ClientRequest +
Simple constructor, creates a client request object requesting events up + from the current date. +
ClientRequest(int) - +Constructor for class shared.remotecall.ClientRequest +
Simple constructor, creates a client request object requesting events up + from the current date. +
Config - class shared.Config.
This class makes all the configuration options available to all the other classes and objects + of this program.
Config() - +Constructor for class shared.Config +
  +
CreateNewEvent - class client.inputforms.CreateNewEvent.
This class contains all the GUI components of the create new event dialog.
CreateNewEvent(NetCalendarClient) - +Constructor for class client.inputforms.CreateNewEvent +
Create the input form window and show it. +
client - package client
 
client.helper - package client.helper
 
client.inputforms - package client.inputforms
 
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-3.html b/javadoc/index-files/index-3.html new file mode 100644 index 0000000..1a8cc97 --- /dev/null +++ b/javadoc/index-files/index-3.html @@ -0,0 +1,159 @@ + + + + + + +D-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+D

+
+
DATE_HEADER - +Static variable in class client.CalendarTableModel +
  +
DELETE_EVENT - +Static variable in class shared.remotecall.ClientRequest +
  +
DESCRIPTION_HEADER - +Static variable in class client.CalendarTableModel +
  +
DateSpinner - class client.helper.DateSpinner.
This helper class helps to create a date spinner to edit Date objects.
DateSpinner() - +Constructor for class client.helper.DateSpinner +
Creates a date spinner to set/edit a given date. +
DateSpinner(Date) - +Constructor for class client.helper.DateSpinner +
Creates a date spinner to set/edit a given date. +
deleteEvent(CalendarEvent) - +Method in class client.NetCalendarClient +
This method tells the calendar server to delete a given calendar event. +
deleteEvent(ClientRequest) - +Method in class server.CalendarDatabase +
This method deletes a calendar event of the calendar database. +
dispose() - +Method in class client.NetCalendarClient +
This method disposes this JFrame window including all the JFrame windows which + belong to this session. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-4.html b/javadoc/index-files/index-4.html new file mode 100644 index 0000000..e2e38dd --- /dev/null +++ b/javadoc/index-files/index-4.html @@ -0,0 +1,140 @@ + + + + + + +E-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+E

+
+
EditExistingEvent - class client.inputforms.EditExistingEvent.
This class contains all the GUI components of the edit event dialog.
EditExistingEvent(NetCalendarClient, CalendarEvent) - +Constructor for class client.inputforms.EditExistingEvent +
Create the input form window and show it. +
exit(int) - +Static method in class shared.Main +
This method is called thenever the server or the client process wants to exit. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-5.html b/javadoc/index-files/index-5.html new file mode 100644 index 0000000..51d2514 --- /dev/null +++ b/javadoc/index-files/index-5.html @@ -0,0 +1,143 @@ + + + + + + +F-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+F

+
+
FLUSH_DATABASE - +Static variable in class shared.remotecall.ClientRequest +
  +
flush() - +Method in class server.CalendarDatabase +
This method flushes all the changed calendar categories of the calendar database to the filesystem. +
flush() - +Method in class shared.CalendarCategory +
This method flushes the calendar category to the database at the filesystem. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-6.html b/javadoc/index-files/index-6.html new file mode 100644 index 0000000..43c9e54 --- /dev/null +++ b/javadoc/index-files/index-6.html @@ -0,0 +1,241 @@ + + + + + + +G-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+G

+
+
GUIHelper - class client.helper.GUIHelper.
This helper class helps to create well arranged GUI components.
GUIHelper() - +Constructor for class client.helper.GUIHelper +
  +
getAllEvents() - +Method in class server.CalendarDatabase +
This method returns a Vector of all available calendar events. +
getBooleanValue(String) - +Static method in class shared.Config +
This method returns a specific boolean config value. +
getCategories() - +Method in class server.CalendarDatabase +
Gets all calendar categories. +
getCategories() - +Method in class server.CalendarFormatParser +
This method returns a vector of all found calendar categories after parsing. +
getCategory(String) - +Method in class server.CalendarDatabase +
Returns a specific calendar category using fast hash lookup. +
getCategory() - +Method in class shared.CalendarEvent +
This event returns the event's calendar category. +
getCategoryName() - +Method in class shared.CalendarEvent +
This method returns the event's category name. +
getColumnClass(int) - +Method in class client.CalendarTableModel +
This method returns the class types of a specific table column. +
getColumnCount() - +Method in class client.CalendarTableModel +
This method returns the number of columns of the JTable. +
getColumnName(int) - +Method in class client.CalendarTableModel +
This method returns the column header of a specific table column. +
getDate() - +Method in class client.helper.DateSpinner +
Returns the date which is represented by this spinner. +
getDate() - +Method in class shared.CalendarEvent +
This method returns the event's date object. +
getDescription() - +Method in class shared.CalendarEvent +
This method returns the event's description string. +
getEvent(int) - +Method in class client.CalendarTableModel +
This method returns the calendar event which belongs to a specific table row +
getEvent(int) - +Method in class server.CalendarDatabase +
Returns a specific calendar event using fast hash lookup. +
getEvent() - +Method in class shared.remotecall.ClientRequest +
This method returns the event object. +
getEventID() - +Method in class shared.CalendarEvent +
This method returns the event's ID number. +
getEvents() - +Method in class shared.CalendarCategory +
This method returns the categorie's events. +
getEvents() - +Method in class shared.remotecall.ServerResponse +
This method returns a vector of all requested calendar events. +
getFile() - +Method in class shared.CalendarCategory +
This method returns the calendar events file object. +
getIntValue(String) - +Static method in class shared.Config +
This method returns a specific integer config value. +
getKeySet() - +Static method in class shared.Config +
This method returns a set of keys of the config hash map. +
getMatchingEvents(ClientRequest) - +Method in class server.CalendarDatabase +
This method looks for all calendar events which match the a given client request. +
getMatchingEvents(ClientRequest) - +Method in class shared.CalendarCategory +
This method looks for all calendar events of this category which matches a given client's request. +
getName() - +Method in class shared.CalendarCategory +
This method returns the categorie's name. +
getNumEventsToRequest() - +Method in class shared.remotecall.ClientRequest +
This method returns the maximum number of events the client wants to request. +
getPlace() - +Method in class shared.CalendarEvent +
This method returns the event's place string. +
getRowCount() - +Method in class client.CalendarTableModel +
This method retuns the number of rows of the JTable. +
getServerAddress() - +Static method in class shared.Config +
This method returns the inet address of the calendar server. +
getSessionString() - +Method in class client.NetCalendarClient +
If the client has several main windows open, then it will display a + session indicator so that the user knows which window belongs to which + session window. +
getSortedKeyArray() - +Static method in class shared.Config +
This method returns a sorted String array of all available config keys. +
getStringValue(String) - +Static method in class shared.Config +
This method returns a specific string config value. +
getTableCellRendererComponent(JTable, Object, boolean, boolean, int, int) - +Method in class client.CalendarTableCellRenderer +
This method returns the Component object of a specific table cell. +
getValueAt(int, int) - +Method in class client.CalendarTableModel +
Gets a specific table value +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-7.html b/javadoc/index-files/index-7.html new file mode 100644 index 0000000..9c19dee --- /dev/null +++ b/javadoc/index-files/index-7.html @@ -0,0 +1,138 @@ + + + + + + +H-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+H

+
+
hasChanged() - +Method in class shared.CalendarCategory +
This method lets you check if the calendar category has been modified/changed by a + calendar client request. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-8.html b/javadoc/index-files/index-8.html new file mode 100644 index 0000000..799b96a --- /dev/null +++ b/javadoc/index-files/index-8.html @@ -0,0 +1,149 @@ + + + + + + +I-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+I

+
+
InputForm - class client.inputforms.InputForm.
This abstract class is the base class of all other classes of the same package.
InputForm(String, NetCalendarClient) - +Constructor for class client.inputforms.InputForm +
Creates the input form window and show it. +
infoMessage(String) - +Static method in class shared.Main +
All info messages of the calendar client and the calendar server go through this method. +
initialize(String[]) - +Static method in class shared.Config +
Initializes all the config values. +
isCellEditable(int, int) - +Method in class client.CalendarTableModel +
This method checks if a cell is editable or not. +
isYearly() - +Method in class shared.CalendarEvent +
This method checks if this event occurs yearly or not. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index-files/index-9.html b/javadoc/index-files/index-9.html new file mode 100644 index 0000000..8d48040 --- /dev/null +++ b/javadoc/index-files/index-9.html @@ -0,0 +1,186 @@ + + + + + + +M-Index + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+

+M

+
+
MODIFY_EVENT - +Static variable in class shared.remotecall.ClientRequest +
  +
Main - class shared.Main.
This class contains the static main method to start the program from.
Main() - +Constructor for class shared.Main +
  +
MyDate - class shared.MyDate.
This class extends the standard Date class and customizes the toString method.
MyDate(Date) - +Constructor for class shared.MyDate +
  +
MyVector - class shared.MyVector.
This class extends the standard Vector class and defined additional help methods.
MyVector() - +Constructor for class shared.MyVector +
  +
main(String[]) - +Static method in class shared.Main +
This method is the start point of the whole program. +
makeCompactGrid(Container, int, int, int, int, int, int) - +Static method in class client.helper.GUIHelper +
Aligns the first iRows * iCols + components of containerParent in + a grid. +
makeGrid(Container, int, int, int, int, int, int) - +Static method in class client.helper.GUIHelper +
Aligns the first iRows * iCols + components of the parent in a grid. +
match(CalendarEvent) - +Method in class shared.remotecall.ClientRequest +
Checks if a specific calendar event matches this client request. +
matches(Pattern) - +Method in class shared.CalendarEvent +
Checks if the current event matches all available data of the event agains + a given regular expression pattern. +
matchesCategory(Pattern) - +Method in class shared.CalendarEvent +
Checks if the current event's category name matches agains a regular expression pattern +
matchesCategoryName(Pattern) - +Method in class shared.CalendarEvent +
Checks if the current event's name matches agains a regular expression pattern. +
matchesDateString(Pattern) - +Method in class shared.CalendarEvent +
Checks if the current event's date string matches agains a regular expression pattern +
matchesDescription(Pattern) - +Method in class shared.CalendarEvent +
Checks if the current event's description string matches agains a regular expression pattern. +
matchesName(Pattern) - +Method in class shared.CalendarCategory +
This method checks the current category's name against a regular expression pattern. +
matchesPlace(Pattern) - +Method in class shared.CalendarEvent +
Checks if the current event's place string matches agains a regular expression pattern. +
modifyEvent(ClientRequest) - +Method in class server.CalendarDatabase +
This method modifies an calendar event of the calendar database. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +A C D E F G H I M N P R S T U V W
+ + + diff --git a/javadoc/index.html b/javadoc/index.html new file mode 100644 index 0000000..dc8e76a --- /dev/null +++ b/javadoc/index.html @@ -0,0 +1,26 @@ + + + + + + +Generated Documentation (Untitled) + + + + + + + + + +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="overview-summary.html">Non-frame version.</A> + + + diff --git a/javadoc/overview-frame.html b/javadoc/overview-frame.html new file mode 100644 index 0000000..cd63f5f --- /dev/null +++ b/javadoc/overview-frame.html @@ -0,0 +1,52 @@ + + + + + + +Overview + + + + + + + + + + + + + + + +
+
+ + + + + +
All Classes +

+ +Packages +
+client +
+client.helper +
+client.inputforms +
+server +
+shared +
+shared.remotecall +
+

+ +

+  + + diff --git a/javadoc/overview-summary.html b/javadoc/overview-summary.html new file mode 100644 index 0000000..025688a --- /dev/null +++ b/javadoc/overview-summary.html @@ -0,0 +1,164 @@ + + + + + + +Overview + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Packages
client 
client.helper 
client.inputforms 
server 
shared 
shared.remotecall 
+ +


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/overview-tree.html b/javadoc/overview-tree.html new file mode 100644 index 0000000..2b39d3d --- /dev/null +++ b/javadoc/overview-tree.html @@ -0,0 +1,192 @@ + + + + + + +Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For All Packages

+
+
+
Package Hierarchies:
client, client.helper, client.inputforms, server, shared, shared.remotecall
+
+

+Class Hierarchy +

+
    +
  • class java.lang.Object
      +
    • class java.util.AbstractCollection (implements java.util.Collection) +
        +
      • class java.util.AbstractList (implements java.util.List) +
          +
        • class java.util.Vector (implements java.lang.Cloneable, java.util.List, java.util.RandomAccess, java.io.Serializable) + +
        +
      +
    • class javax.swing.table.AbstractTableModel (implements java.io.Serializable, javax.swing.table.TableModel) + +
    • class shared.CalendarCategory
    • class server.CalendarDatabase
    • class shared.CalendarEvent (implements java.io.Serializable) +
    • class server.CalendarFormatParser
    • class java.awt.Component (implements java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable) +
        +
      • class java.awt.Container
          +
        • class javax.swing.JComponent (implements java.io.Serializable) +
            +
          • class client.helper.DateSpinner
          • class javax.swing.JLabel (implements javax.accessibility.Accessible, javax.swing.SwingConstants) +
              +
            • class javax.swing.table.DefaultTableCellRenderer (implements java.io.Serializable, javax.swing.table.TableCellRenderer) + +
            +
          +
        • class java.awt.Window (implements javax.accessibility.Accessible) + +
        +
      +
    • class shared.Config
    • class java.util.Date (implements java.lang.Cloneable, java.lang.Comparable, java.io.Serializable) + +
    • class client.helper.GUIHelper
    • class shared.Main
    • class shared.remotecall.RemoteCall
        +
      • class shared.remotecall.ClientRequest (implements java.io.Serializable) +
      • class shared.remotecall.ServerResponse (implements java.io.Serializable) +
      +
    • class client.ServerRequester
    • class java.lang.Thread (implements java.lang.Runnable) + +
    +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/package-list b/javadoc/package-list new file mode 100644 index 0000000..ba15529 --- /dev/null +++ b/javadoc/package-list @@ -0,0 +1,6 @@ +client +client.helper +client.inputforms +server +shared +shared.remotecall diff --git a/javadoc/packages.html b/javadoc/packages.html new file mode 100644 index 0000000..5ca0de0 --- /dev/null +++ b/javadoc/packages.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+The front page has been relocated.Please see: +
+          Frame version +
+          Non-frame version.
+ + + diff --git a/javadoc/resources/inherit.gif b/javadoc/resources/inherit.gif new file mode 100644 index 0000000..c814867 Binary files /dev/null and b/javadoc/resources/inherit.gif differ diff --git a/javadoc/serialized-form.html b/javadoc/serialized-form.html new file mode 100644 index 0000000..d885cdb --- /dev/null +++ b/javadoc/serialized-form.html @@ -0,0 +1,1016 @@ + + + + + + +Serialized Form + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Serialized Form

+
+
+ + + + + +
+Package shared
+ +

+ + + + + +
+Class shared.CalendarEvent extends java.lang.Object implements Serializable
+ +

+serialVersionUID: 1l + +

+ + + + + +
+Serialization Methods
+ +

+ +

+readObject

+
+private void readObject(java.io.ObjectInputStream objectInputStream)
+                 throws java.io.IOException,
+                        java.lang.ClassNotFoundException
+
+
Needed for object serialization (receiving part). +

+

+ +
Throws: +
java.io.IOException +
java.lang.ClassNotFoundException
+
+
+
+ +

+writeObject

+
+private void writeObject(java.io.ObjectOutputStream objectOutputStream)
+                  throws java.io.IOException
+
+
Needed for ojbect serialization (sending part)- +

+

+ +
Throws: +
java.io.IOException
+
+
+ + + + + +
+Serialized Fields
+ +

+date

+
+MyDate date
+
+
+
+
+
+ +

+category

+
+CalendarCategory category
+
+
+
+
+
+ +

+sCategoryName

+
+java.lang.String sCategoryName
+
+
+
+
+
+ +

+sDescription

+
+java.lang.String sDescription
+
+
+
+
+
+ +

+sPlace

+
+java.lang.String sPlace
+
+
+
+
+
+ +

+bYearly

+
+boolean bYearly
+
+
+
+
+
+ +

+iEventID

+
+int iEventID
+
+
+
+
+ +

+ + + + + +
+Class shared.MyDate extends java.util.Date implements Serializable
+ +

+serialVersionUID: 1l + +

+ +

+ + + + + +
+Class shared.MyVector extends java.util.Vector implements Serializable
+ +

+serialVersionUID: 1l + +

+ +

+


+ + + + + +
+Package client.inputforms
+ +

+ + + + + +
+Class client.inputforms.AdvancedSearching extends InputForm implements Serializable
+ +

+serialVersionUID: 1l + +

+ +

+ + + + + +
+Class client.inputforms.CreateNewEvent extends InputForm implements Serializable
+ +

+serialVersionUID: 1l + +

+ +

+ + + + + +
+Class client.inputforms.EditExistingEvent extends InputForm implements Serializable
+ +

+serialVersionUID: 1l + +

+ + + + + +
+Serialized Fields
+ +

+originalCalendarEvent

+
+CalendarEvent originalCalendarEvent
+
+
+
+
+
+ +

+date

+
+java.util.Date date
+
+
+
+
+ +

+ + + + + +
+Class client.inputforms.InputForm extends javax.swing.JFrame implements Serializable
+ +

+serialVersionUID: 1l + +

+ + + + + +
+Serialized Fields
+ +

+netCalendarClient

+
+NetCalendarClient netCalendarClient
+
+
+
+
+
+ +

+inputForm

+
+InputForm inputForm
+
+
+
+
+
+ +

+vecFields

+
+java.util.Vector vecFields
+
+
+
+
+ +

+ + + + + +
+Class client.inputforms.Preferences extends InputForm implements Serializable
+ +

+serialVersionUID: 1l + +

+ + + + + +
+Serialized Fields
+ +

+labels

+
+java.lang.String[] labels
+
+
+
+
+
+ +

+iNumPairs

+
+int iNumPairs
+
+
+
+
+ +

+


+ + + + + +
+Package client
+ +

+ + + + + +
+Class client.CalendarTableCellRenderer extends javax.swing.table.DefaultTableCellRenderer implements Serializable
+ +

+serialVersionUID: 1l + +

+ + + + + +
+Serialized Fields
+ +

+tableModel

+
+CalendarTableModel tableModel
+
+
+
+
+ +

+ + + + + +
+Class client.CalendarTableModel extends javax.swing.table.AbstractTableModel implements Serializable
+ +

+serialVersionUID: 1l + +

+ + + + + +
+Serialized Fields
+ +

+iRows

+
+int iRows
+
+
+
+
+
+ +

+vecEvents

+
+java.util.Vector vecEvents
+
+
+
+
+
+ +

+lastSortComparator

+
+java.util.Comparator lastSortComparator
+
+
+
+
+
+ +

+jTable

+
+javax.swing.JTable jTable
+
+
+
+
+ +

+ + + + + +
+Class client.NetCalendarClient extends javax.swing.JFrame implements Serializable
+ +

+serialVersionUID: 1l + +

+ + + + + +
+Serialized Fields
+ +

+iCurrentSession

+
+int iCurrentSession
+
+
+
+
+
+ +

+netCalendarClient

+
+NetCalendarClient netCalendarClient
+
+
+
+
+
+ +

+vecFrames

+
+java.util.Vector vecFrames
+
+
+
+
+
+ +

+lastClientRequest

+
+ClientRequest lastClientRequest
+
+
+
+
+
+ +

+iCurrentMouseSelectedRow

+
+int iCurrentMouseSelectedRow
+
+
+
+
+
+ +

+iCurrentMouseSelectedCol

+
+int iCurrentMouseSelectedCol
+
+
+
+
+
+ +

+jMenuBar

+
+javax.swing.JMenuBar jMenuBar
+
+
+
+
+
+ +

+jPopupMenu

+
+javax.swing.JPopupMenu jPopupMenu
+
+
+
+
+
+ +

+tableModel

+
+CalendarTableModel tableModel
+
+
+
+
+
+ +

+jTable

+
+javax.swing.JTable jTable
+
+
+
+
+
+ +

+jTextFieldRegexp

+
+javax.swing.JTextField jTextFieldRegexp
+
+
+
+
+
+ +

+jTextFieldStatusMessages

+
+javax.swing.JTextField jTextFieldStatusMessages
+
+
+
+
+ +

+


+ + + + + +
+Package client.helper
+ +

+ + + + + +
+Class client.helper.DateSpinner extends javax.swing.JComponent implements Serializable
+ +

+serialVersionUID: 1l + +

+ + + + + +
+Serialized Fields
+ +

+date

+
+java.util.Date date
+
+
+
+
+
+ +

+spinnerDateModel

+
+javax.swing.SpinnerDateModel spinnerDateModel
+
+
+
+
+ +

+


+ + + + + +
+Package shared.remotecall
+ +

+ + + + + +
+Class shared.remotecall.ClientRequest extends RemoteCall implements Serializable
+ +

+serialVersionUID: 4l + +

+ + + + + +
+Serialization Methods
+ +

+ +

+readObject

+
+private void readObject(java.io.ObjectInputStream objectInputStream)
+                 throws java.io.IOException,
+                        java.lang.ClassNotFoundException
+
+
Needed for object serialization (recieving part). +

+

+ +
Throws: +
java.io.IOException +
java.lang.ClassNotFoundException
+
+
+
+ +

+writeObject

+
+private void writeObject(java.io.ObjectOutputStream objectOutputStream)
+                  throws java.io.IOException
+
+
Needed for ojbect serialization (sending part). +

+

+ +
Throws: +
java.io.IOException
+
+
+ + + + + +
+Serialized Fields
+ +

+iAction

+
+int iAction
+
+
+
+
+
+ +

+iNumEventsToRequest

+
+int iNumEventsToRequest
+
+
+
+
+
+ +

+bMainRegexp

+
+boolean bMainRegexp
+
+
+
+
+
+ +

+patAll

+
+java.util.regex.Pattern patAll
+
+
+
+
+
+ +

+patCategory

+
+java.util.regex.Pattern patCategory
+
+
+
+
+
+ +

+patDescription

+
+java.util.regex.Pattern patDescription
+
+
+
+
+
+ +

+patPlace

+
+java.util.regex.Pattern patPlace
+
+
+
+
+
+ +

+patDate

+
+java.util.regex.Pattern patDate
+
+
+
+
+
+ +

+dateRangeFrom

+
+java.util.Date dateRangeFrom
+
+
+
+
+
+ +

+dateRangeTo

+
+java.util.Date dateRangeTo
+
+
+
+
+
+ +

+event

+
+CalendarEvent event
+
+
+
+
+ +

+ + + + + +
+Class shared.remotecall.ServerResponse extends RemoteCall implements Serializable
+ +

+serialVersionUID: 1l + +

+ + + + + +
+Serialization Methods
+ +

+ +

+readObject

+
+private void readObject(java.io.ObjectInputStream objectInputStream)
+                 throws java.io.IOException,
+                        java.lang.ClassNotFoundException
+
+
Needed for object serialization (recieving part). +

+

+ +
Throws: +
java.io.IOException +
java.lang.ClassNotFoundException
+
+
+
+ +

+writeObject

+
+private void writeObject(java.io.ObjectOutputStream objectOutputStream)
+                  throws java.io.IOException
+
+
Needed for ojbect serialization (sending part). +

+

+ +
Throws: +
java.io.IOException
+
+
+ + + + + +
+Serialized Fields
+ +

+vecEvents

+
+java.util.Vector vecEvents
+
+
+
+
+ +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/server/CalendarDatabase.html b/javadoc/server/CalendarDatabase.html new file mode 100644 index 0000000..81605d6 --- /dev/null +++ b/javadoc/server/CalendarDatabase.html @@ -0,0 +1,439 @@ + + + + + + +CalendarDatabase + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +server +
+Class CalendarDatabase

+
+java.lang.Object
+  extended byserver.CalendarDatabase
+
+
+
+
public final class CalendarDatabase
extends java.lang.Object
+ +

+A object of this class encapsulates the whole calendar database on the server side. + This class is used for getting/modifying and adding/removing of calendar events. +

+ +

+

+
Author:
+
buetow
+
+
+ +

+ + + + + + + + + + + + + + + + +
+Constructor Summary
CalendarDatabase(java.util.Vector vecCategories) + +
+          Simple constructur.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidaddEvent(ClientRequest clientRequest) + +
+          This method adds a calendar event to the calendar database.
+ voiddeleteEvent(ClientRequest clientRequest) + +
+          This method deletes a calendar event of the calendar database.
+ voidflush() + +
+          This method flushes all the changed calendar categories of the calendar database to the filesystem.
+ java.util.VectorgetAllEvents() + +
+          This method returns a Vector of all available calendar events.
+ java.util.VectorgetCategories() + +
+          Gets all calendar categories.
+ CalendarCategorygetCategory(java.lang.String sCategoryName) + +
+          Returns a specific calendar category using fast hash lookup.
+ CalendarEventgetEvent(int iEventID) + +
+          Returns a specific calendar event using fast hash lookup.
+ java.util.VectorgetMatchingEvents(ClientRequest clientRequest) + +
+          This method looks for all calendar events which match the a given client request.
+ voidmodifyEvent(ClientRequest clientRequest) + +
+          This method modifies an calendar event of the calendar database.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+CalendarDatabase

+
+public CalendarDatabase(java.util.Vector vecCategories)
+
+
Simple constructur. Creates a calendar database. +

+

Parameters:
vecCategories - Specifies the vector of CalendarCategory objects for initial database content.
+ + + + + + + + +
+Method Detail
+ +

+getEvent

+
+public CalendarEvent getEvent(int iEventID)
+
+
Returns a specific calendar event using fast hash lookup. +

+

+
Parameters:
iEventID - Specifies the ID of the calendar event to lookup. +
Returns:
Returns the requested calendar event.
+
+
+
+ +

+getCategory

+
+public CalendarCategory getCategory(java.lang.String sCategoryName)
+
+
Returns a specific calendar category using fast hash lookup. +

+

+
Parameters:
sCategoryName - Specifies the name of the calendar category to lookup. +
Returns:
Returns the requested calendar category.
+
+
+
+ +

+getCategories

+
+public java.util.Vector getCategories()
+
+
Gets all calendar categories. +

+

+ +
Returns:
Returns a Vector of all available CalendarCategory objects.
+
+
+
+ +

+getAllEvents

+
+public java.util.Vector getAllEvents()
+
+
This method returns a Vector of all available calendar events. +

+

+ +
Returns:
Returns all available CalendarEvent objects of the database.
+
+
+
+ +

+getMatchingEvents

+
+public java.util.Vector getMatchingEvents(ClientRequest clientRequest)
+
+
This method looks for all calendar events which match the a given client request. +

+

+
Parameters:
clientRequest - Specifies the client request sent by the calendar client. +
Returns:
Returns a Vector of all matching CalendarEvent objects.
+
+
+
+ +

+addEvent

+
+public void addEvent(ClientRequest clientRequest)
+
+
This method adds a calendar event to the calendar database. +

+

+
Parameters:
clientRequest - Specifies the client request sent by the netcalendar client. Its containing the new event to add.
+
+
+
+ +

+modifyEvent

+
+public void modifyEvent(ClientRequest clientRequest)
+
+
This method modifies an calendar event of the calendar database. +

+

+
Parameters:
clientRequest - Specifies the client request sent by the calendar client.
+
+
+
+ +

+deleteEvent

+
+public void deleteEvent(ClientRequest clientRequest)
+
+
This method deletes a calendar event of the calendar database. If the specified calendar event doesnt + exist eny more, nothing will be changed. +

+

+
Parameters:
clientRequest - Specifies the client request sent by the netcalendar client.
+
+
+
+ +

+flush

+
+public void flush()
+
+
This method flushes all the changed calendar categories of the calendar database to the filesystem. +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/server/CalendarFormatParser.html b/javadoc/server/CalendarFormatParser.html new file mode 100644 index 0000000..d864051 --- /dev/null +++ b/javadoc/server/CalendarFormatParser.html @@ -0,0 +1,311 @@ + + + + + + +CalendarFormatParser + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +server +
+Class CalendarFormatParser

+
+java.lang.Object
+  extended byserver.CalendarFormatParser
+
+
+
+
public final class CalendarFormatParser
extends java.lang.Object
+ +

+This class is needed for parsing the original UNIX calendar database format. + Its parsing the calendar database from the file-system and its caching it into the + memory. Then, the CalendarDatabase class can be used to access the database. + Each calendar category has its own file. In each file all the calendar events of the + specific categories are stored. +

+ +

+

+
Author:
+
buetow
+
+
+ +

+ + + + + + + + + + + + + + + + +
+Constructor Summary
CalendarFormatParser() + +
+          Simple constructor.
+  + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ java.util.VectorgetCategories() + +
+          This method returns a vector of all found calendar categories after parsing.
+ voidsetWorkdir(java.lang.String sWorkdir) + +
+          This method sets the working directory.
+ voidstart() + +
+          Starts the parsing work of the calendar database files.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+CalendarFormatParser

+
+public CalendarFormatParser()
+
+
Simple constructor. Creates a calendar format parser object and initializes some private members. +

+

+ + + + + + + + +
+Method Detail
+ +

+getCategories

+
+public java.util.Vector getCategories()
+
+
This method returns a vector of all found calendar categories after parsing. +

+

+ +
Returns:
Returns a Vector of all available CalendarCategory objects.
+
+
+
+ +

+setWorkdir

+
+public void setWorkdir(java.lang.String sWorkdir)
+
+
This method sets the working directory. Its the "server_workdir" variable defined in the current configuration by default. +

+

+
Parameters:
sWorkdir - Specifies the working directory.
+
+
+
+ +

+start

+
+public void start()
+
+
Starts the parsing work of the calendar database files. +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/server/NetCalendarServer.html b/javadoc/server/NetCalendarServer.html new file mode 100644 index 0000000..48dd847 --- /dev/null +++ b/javadoc/server/NetCalendarServer.html @@ -0,0 +1,296 @@ + + + + + + +NetCalendarServer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +server +
+Class NetCalendarServer

+
+java.lang.Object
+  extended byjava.lang.Thread
+      extended byserver.NetCalendarServer
+
+
+
All Implemented Interfaces:
java.lang.Runnable
+
+
+
+
public class NetCalendarServer
extends java.lang.Thread
+ +

+This is the main class of the server part of the netcalendar suite. + It contains the server socket part and hold a references to the calendar database. +

+ +

+

+
Author:
+
buetow
+
+
+ +

+ + + + + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
+  + + + + + + + + + + +
+Constructor Summary
NetCalendarServer(int iPort, + java.lang.String sWorkdir) + +
+          Creates a NetCalendarServer instance and runs it as a thread.
+  + + + + + + + + + + + +
+Method Summary
+ voidrun() + +
+          This method specifies the start method of the Thread.
+ + + + + + + +
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+NetCalendarServer

+
+public NetCalendarServer(int iPort,
+                         java.lang.String sWorkdir)
+
+
Creates a NetCalendarServer instance and runs it as a thread. +

+

Parameters:
iPort - Specifies the server port of the server to be used.
sWorkdir - Specifies the working directory of the server.
+ + + + + + + + +
+Method Detail
+ +

+run

+
+public void run()
+
+
This method specifies the start method of the Thread. Its setting up the server port. +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/server/class-use/CalendarDatabase.html b/javadoc/server/class-use/CalendarDatabase.html new file mode 100644 index 0000000..da1626e --- /dev/null +++ b/javadoc/server/class-use/CalendarDatabase.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Class server.CalendarDatabase + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
server.CalendarDatabase

+
+No usage of server.CalendarDatabase +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/server/class-use/CalendarFormatParser.html b/javadoc/server/class-use/CalendarFormatParser.html new file mode 100644 index 0000000..2555abe --- /dev/null +++ b/javadoc/server/class-use/CalendarFormatParser.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Class server.CalendarFormatParser + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
server.CalendarFormatParser

+
+No usage of server.CalendarFormatParser +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/server/class-use/NetCalendarServer.html b/javadoc/server/class-use/NetCalendarServer.html new file mode 100644 index 0000000..afd8b79 --- /dev/null +++ b/javadoc/server/class-use/NetCalendarServer.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Class server.NetCalendarServer + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
server.NetCalendarServer

+
+No usage of server.NetCalendarServer +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/server/package-frame.html b/javadoc/server/package-frame.html new file mode 100644 index 0000000..6a0d3ec --- /dev/null +++ b/javadoc/server/package-frame.html @@ -0,0 +1,36 @@ + + + + + + +server + + + + + + + + + + + +server + + + + +
+Classes  + +
+CalendarDatabase +
+CalendarFormatParser +
+NetCalendarServer
+ + + + diff --git a/javadoc/server/package-summary.html b/javadoc/server/package-summary.html new file mode 100644 index 0000000..2da7ef7 --- /dev/null +++ b/javadoc/server/package-summary.html @@ -0,0 +1,156 @@ + + + + + + +server + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package server +

+ + + + + + + + + + + + + + + + + +
+Class Summary
CalendarDatabaseA object of this class encapsulates the whole calendar database on the server side.
CalendarFormatParserThis class is needed for parsing the original UNIX calendar database format.
NetCalendarServerThis is the main class of the server part of the netcalendar suite.
+  + +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/server/package-tree.html b/javadoc/server/package-tree.html new file mode 100644 index 0000000..e89dd53 --- /dev/null +++ b/javadoc/server/package-tree.html @@ -0,0 +1,148 @@ + + + + + + +server Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package server +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/server/package-use.html b/javadoc/server/package-use.html new file mode 100644 index 0000000..527ea6c --- /dev/null +++ b/javadoc/server/package-use.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Package server + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
server

+
+No usage of server +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/CalendarCategory.html b/javadoc/shared/CalendarCategory.html new file mode 100644 index 0000000..de6c3e8 --- /dev/null +++ b/javadoc/shared/CalendarCategory.html @@ -0,0 +1,522 @@ + + + + + + +CalendarCategory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +shared +
+Class CalendarCategory

+
+java.lang.Object
+  extended byshared.CalendarCategory
+
+
+
+
public class CalendarCategory
extends java.lang.Object
+ +

+This class specifies a category of the calendar events. Its wrapping a vector of references + of all events of this category. +

+ +

+

+
Author:
+
buetow
+
+
+ +

+ + + + + + + + + + + + + + + + + + + +
+Constructor Summary
CalendarCategory(java.io.File categoryFile) + +
+          Creates a new calendar category object and sets the categorie's name to the filename of the category.
CalendarCategory(java.lang.String sCategoryName) + +
+          Creates a new calendar category object and sets the categorie's File to the name of the category.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidaddEvent(CalendarEvent event) + +
+          This method adds an event to the category.
+ voidflush() + +
+          This method flushes the calendar category to the database at the filesystem.
+ java.util.VectorgetEvents() + +
+          This method returns the categorie's events.
+ java.io.FilegetFile() + +
+          This method returns the calendar events file object.
+ java.util.VectorgetMatchingEvents(ClientRequest clientRequest) + +
+          This method looks for all calendar events of this category which matches a given client's request.
+ java.lang.StringgetName() + +
+          This method returns the categorie's name.
+ booleanhasChanged() + +
+          This method lets you check if the calendar category has been modified/changed by a + calendar client request.
+ booleanmatchesName(java.util.regex.Pattern pattern) + +
+          This method checks the current category's name against a regular expression pattern.
+ voidremoveEvent(CalendarEvent event) + +
+          This method removes a given event from its event vector.
+ voidsetEvents(java.util.Vector vecEvents) + +
+          This method sets the categorie's initial events.
+ voidsetHasChanged(boolean bHasChanged) + +
+          This method specifies if the calendar category has been modified/changed or not.
+ voidunsetFile() + +
+          This method Sets the categories file handle to null.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+CalendarCategory

+
+public CalendarCategory(java.io.File categoryFile)
+
+
Creates a new calendar category object and sets the categorie's name to the filename of the category. +

+

Parameters:
categoryFile - The file object which contains the unparsed events for this specific category. It will be unset after parsing.
+
+ +

+CalendarCategory

+
+public CalendarCategory(java.lang.String sCategoryName)
+
+
Creates a new calendar category object and sets the categorie's File to the name of the category. +

+

Parameters:
sCategoryName - Specifies the categorie's name.
+ + + + + + + + +
+Method Detail
+ +

+setEvents

+
+public void setEvents(java.util.Vector vecEvents)
+
+
This method sets the categorie's initial events. +

+

+
Parameters:
vecEvents - Specifies the categorie's events.
+
+
+
+ +

+addEvent

+
+public void addEvent(CalendarEvent event)
+
+
This method adds an event to the category. +

+

+
Parameters:
event - Specifies the calendar event to add to this category.
+
+
+
+ +

+getFile

+
+public java.io.File getFile()
+
+
This method returns the calendar events file object. +

+

+ +
Returns:
Returns the categorie's file object.
+
+
+
+ +

+unsetFile

+
+public void unsetFile()
+
+
This method Sets the categories file handle to null. This is done if all the data has been read from + the file database. +

+

+
+
+
+
+ +

+getName

+
+public java.lang.String getName()
+
+
This method returns the categorie's name. +

+

+ +
Returns:
Returns the categorie's name.
+
+
+
+ +

+getEvents

+
+public java.util.Vector getEvents()
+
+
This method returns the categorie's events. +

+

+ +
Returns:
Returns a Vector of all CalendarEvent objects.
+
+
+
+ +

+getMatchingEvents

+
+public java.util.Vector getMatchingEvents(ClientRequest clientRequest)
+
+
This method looks for all calendar events of this category which matches a given client's request. +

+

+
Parameters:
clientRequest - Specifies the client request sent by the calendar client. +
Returns:
Returns a Vector of all matching CalendarEvent objects.
+
+
+
+ +

+matchesName

+
+public boolean matchesName(java.util.regex.Pattern pattern)
+
+
This method checks the current category's name against a regular expression pattern. +

+

+
Parameters:
pattern - Specifies the pattern to be used. +
Returns:
Returns true if the event matches, else false will be returned.
+
+
+
+ +

+removeEvent

+
+public void removeEvent(CalendarEvent event)
+
+
This method removes a given event from its event vector. +

+

+
Parameters:
event - Specifies the calendar event object to be removed from this category
+
+
+
+ +

+hasChanged

+
+public boolean hasChanged()
+
+
This method lets you check if the calendar category has been modified/changed by a + calendar client request. This is needed by the CalendarDatabase.flush method, to write all + the changes back to the database files. +

+

+ +
Returns:
Returns true if the category has changed, else it will return false.
+
+
+
+ +

+setHasChanged

+
+public void setHasChanged(boolean bHasChanged)
+
+
This method specifies if the calendar category has been modified/changed or not. +

+

+
Parameters:
bHasChanged - Specifies if the category has been modified/changed or not.
+
+
+
+ +

+flush

+
+public void flush()
+
+
This method flushes the calendar category to the database at the filesystem. +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/CalendarEvent.html b/javadoc/shared/CalendarEvent.html new file mode 100644 index 0000000..d8de0c9 --- /dev/null +++ b/javadoc/shared/CalendarEvent.html @@ -0,0 +1,809 @@ + + + + + + +CalendarEvent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +shared +
+Class CalendarEvent

+
+java.lang.Object
+  extended byshared.CalendarEvent
+
+
+
All Implemented Interfaces:
java.io.Serializable
+
+
+
+
public class CalendarEvent
extends java.lang.Object
implements java.io.Serializable
+ +

+This class specifies calendar events. Calendar event objects are the most used objects of the + whole netcalendar suite. +

+ +

+

+
Author:
+
buetow
+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + + + + + + +
+Constructor Summary
CalendarEvent(CalendarCategory category) + +
+          Simple constructor, creates an event object and increments iEventIDCount by one.
CalendarEvent(java.lang.String sCategoryName) + +
+          Simple constructor, creates an event object and increments iEventIDCount by one.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ CalendarCategorygetCategory() + +
+          This event returns the event's calendar category.
+ java.lang.StringgetCategoryName() + +
+          This method returns the event's category name.
+ MyDategetDate() + +
+          This method returns the event's date object.
+ java.lang.StringgetDescription() + +
+          This method returns the event's description string.
+ intgetEventID() + +
+          This method returns the event's ID number.
+ java.lang.StringgetPlace() + +
+          This method returns the event's place string.
+ booleanisYearly() + +
+          This method checks if this event occurs yearly or not.
+ booleanmatches(java.util.regex.Pattern pattern) + +
+          Checks if the current event matches all available data of the event agains + a given regular expression pattern.
+ booleanmatchesCategory(java.util.regex.Pattern pattern) + +
+          Checks if the current event's category name matches agains a regular expression pattern
+ booleanmatchesCategoryName(java.util.regex.Pattern pattern) + +
+          Checks if the current event's name matches agains a regular expression pattern.
+ booleanmatchesDateString(java.util.regex.Pattern pattern) + +
+          Checks if the current event's date string matches agains a regular expression pattern
+ booleanmatchesDescription(java.util.regex.Pattern pattern) + +
+          Checks if the current event's description string matches agains a regular expression pattern.
+ booleanmatchesPlace(java.util.regex.Pattern pattern) + +
+          Checks if the current event's place string matches agains a regular expression pattern.
+ voidremoveFromCurrentCategory() + +
+          Removes the calendar event from its current category and sets the + category reference to null.
+ voidsetCategory(CalendarCategory category) + +
+          This method sets the event's category.
+ voidsetCategoryName(java.lang.String sCategoryName) + +
+          This methos sets thhe event's category name.
+ voidsetDate(java.util.Date date) + +
+          This method sets the event's date.
+ voidsetDescription(java.lang.String sDescription) + +
+          This method sets the event's descriptions tring.
+ voidsetEventID(int iEventID) + +
+          This method sets the event's ID number.
+ voidsetPlace(java.lang.String sPlace) + +
+          This method sets the event's place string.
+ voidsetYearly(boolean bYearly) + +
+          This method specifies if this event occurs yearly or not.
+ java.lang.StringtoString() + +
+          This method is needed for a text representation of the object.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+CalendarEvent

+
+public CalendarEvent(CalendarCategory category)
+
+
Simple constructor, creates an event object and increments iEventIDCount by one. +

+

Parameters:
category - Specifies the event's category.
+
+ +

+CalendarEvent

+
+public CalendarEvent(java.lang.String sCategoryName)
+
+
Simple constructor, creates an event object and increments iEventIDCount by one. +

+

Parameters:
sCategoryName - Specifies the event's category name.
+ + + + + + + + +
+Method Detail
+ +

+setDate

+
+public void setDate(java.util.Date date)
+
+
This method sets the event's date. +

+

+
+
+
+
Parameters:
date - Specifies the event's date.
+
+
+
+ +

+setCategory

+
+public void setCategory(CalendarCategory category)
+
+
This method sets the event's category. +

+

+
+
+
+
Parameters:
category - Specifies the event's category.
+
+
+
+ +

+getCategory

+
+public CalendarCategory getCategory()
+
+
This event returns the event's calendar category. +

+

+
+
+
+ +
Returns:
Returns the event's calenda category.
+
+
+
+ +

+setCategoryName

+
+public void setCategoryName(java.lang.String sCategoryName)
+
+
This methos sets thhe event's category name. +

+

+
+
+
+
Parameters:
sCategoryName - Specifies the event's category name.
+
+
+
+ +

+setDescription

+
+public void setDescription(java.lang.String sDescription)
+
+
This method sets the event's descriptions tring. +

+

+
+
+
+
Parameters:
sDescription - Specifies the event's description string.
+
+
+
+ +

+setPlace

+
+public void setPlace(java.lang.String sPlace)
+
+
This method sets the event's place string. +

+

+
+
+
+
Parameters:
sPlace - Specifies the event's place string.
+
+
+
+ +

+setEventID

+
+public void setEventID(int iEventID)
+
+
This method sets the event's ID number. +

+

+
+
+
+
Parameters:
iEventID - specifies the event's ID number.
+
+
+
+ +

+setYearly

+
+public void setYearly(boolean bYearly)
+
+
This method specifies if this event occurs yearly or not. +

+

+
+
+
+
Parameters:
bYearly - Specifies if this event occury yearly or not.
+
+
+
+ +

+getCategoryName

+
+public java.lang.String getCategoryName()
+
+
This method returns the event's category name. +

+

+
+
+
+ +
Returns:
Returns the event's category name.
+
+
+
+ +

+getDescription

+
+public java.lang.String getDescription()
+
+
This method returns the event's description string. +

+

+
+
+
+ +
Returns:
Returns the event's description string.
+
+
+
+ +

+getPlace

+
+public java.lang.String getPlace()
+
+
This method returns the event's place string. +

+

+
+
+
+ +
Returns:
Returns the event's place string.
+
+
+
+ +

+getDate

+
+public MyDate getDate()
+
+
This method returns the event's date object. +

+

+
+
+
+ +
Returns:
Returns the event's date object.
+
+
+
+ +

+getEventID

+
+public int getEventID()
+
+
This method returns the event's ID number. +

+

+
+
+
+ +
Returns:
Returns the event's ID number.
+
+
+
+ +

+isYearly

+
+public boolean isYearly()
+
+
This method checks if this event occurs yearly or not. +

+

+
+
+
+ +
Returns:
Returns true if the event occurs yearly, else it returns false.
+
+
+
+ +

+matches

+
+public boolean matches(java.util.regex.Pattern pattern)
+
+
Checks if the current event matches all available data of the event agains + a given regular expression pattern. +

+

+
+
+
+
Parameters:
pattern - Specifies the pattern to match against. +
Returns:
Returns true if one element of the event matches.
+
+
+
+ +

+matchesCategoryName

+
+public boolean matchesCategoryName(java.util.regex.Pattern pattern)
+
+
Checks if the current event's name matches agains a regular expression pattern. +

+

+
+
+
+
Parameters:
pattern - Specifies the pattern to be matched against. +
Returns:
Returns true if the event matches, else false will be returned. If the pattern is null, true will be returned.
+
+
+
+ +

+matchesDescription

+
+public boolean matchesDescription(java.util.regex.Pattern pattern)
+
+
Checks if the current event's description string matches agains a regular expression pattern. +

+

+
+
+
+
Parameters:
pattern - Specifies the pattern to match against. +
Returns:
Returns true if the event matches, else false will be returned. If the pattern is null, true will be returned.
+
+
+
+ +

+matchesPlace

+
+public boolean matchesPlace(java.util.regex.Pattern pattern)
+
+
Checks if the current event's place string matches agains a regular expression pattern. +

+

+
+
+
+
Parameters:
pattern - Specifies the pattern to match against. +
Returns:
Returns true if the event matches, else false will be returned. If the pattern is null, true will be returned.
+
+
+
+ +

+matchesCategory

+
+public boolean matchesCategory(java.util.regex.Pattern pattern)
+
+
Checks if the current event's category name matches agains a regular expression pattern +

+

+
+
+
+
Parameters:
pattern - Specifies the pattern to match against. +
Returns:
Returns true if the event matches, else false will be returned. If the pattern is null, true will be returned.
+
+
+
+ +

+matchesDateString

+
+public boolean matchesDateString(java.util.regex.Pattern pattern)
+
+
Checks if the current event's date string matches agains a regular expression pattern +

+

+
+
+
+
Parameters:
pattern - Specifies the pattern to match against. +
Returns:
Returns true if the event matches, else false will be returned. If the pattern is null, true will be returned.
+
+
+
+ +

+removeFromCurrentCategory

+
+public void removeFromCurrentCategory()
+
+
Removes the calendar event from its current category and sets the + category reference to null. +

+

+
+
+
+
+
+
+
+ +

+toString

+
+public java.lang.String toString()
+
+
This method is needed for a text representation of the object. +

+

+
+
+
+ +
Returns:
Returns object represented as a String.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/Config.html b/javadoc/shared/Config.html new file mode 100644 index 0000000..0c4e88e --- /dev/null +++ b/javadoc/shared/Config.html @@ -0,0 +1,491 @@ + + + + + + +Config + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +shared +
+Class Config

+
+java.lang.Object
+  extended byshared.Config
+
+
+
+
public final class Config
extends java.lang.Object
+ +

+This class makes all the configuration options available to all the other classes and objects + of this program. Its reading and writing back the values from and to the config.txt file. +

+ +

+

+
Author:
+
buetow
+
+
+ +

+ + + + + + + + + + + + + + +
+Field Summary
+static java.lang.StringVERSION + +
+           
+  + + + + + + + + + + +
+Constructor Summary
Config() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+static booleangetBooleanValue(java.lang.String sKey) + +
+          This method returns a specific boolean config value.
+static intgetIntValue(java.lang.String sKey) + +
+          This method returns a specific integer config value.
+static java.util.SetgetKeySet() + +
+          This method returns a set of keys of the config hash map.
+static java.net.InetAddressgetServerAddress() + +
+          This method returns the inet address of the calendar server.
+static java.lang.String[]getSortedKeyArray() + +
+          This method returns a sorted String array of all available config keys.
+static java.lang.StringgetStringValue(java.lang.String sKey) + +
+          This method returns a specific string config value.
+static voidinitialize(java.lang.String[] args) + +
+          Initializes all the config values.
+static voidreadConfig(java.lang.String sConfigFile) + +
+          This methods reads the options from the calendar config file 'config.txt'.
+static voidsetValue(java.lang.String sKey, + java.lang.String sVal) + +
+          This method changes or adds a specific config value.
+static voidwriteConfigToFile() + +
+          This method writes the current configuration to the config file "config.txt".
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+VERSION

+
+public static final java.lang.String VERSION
+
+
+
See Also:
Constant Field Values
+
+ + + + + + + + +
+Constructor Detail
+ +

+Config

+
+public Config()
+
+
+ + + + + + + + +
+Method Detail
+ +

+initialize

+
+public static void initialize(java.lang.String[] args)
+
+
Initializes all the config values. +

+

+
Parameters:
args - The start parameters.
+
+
+
+ +

+readConfig

+
+public static void readConfig(java.lang.String sConfigFile)
+
+
This methods reads the options from the calendar config file 'config.txt'. +

+

+
Parameters:
sConfigFile - Specifies the relative or absolute path to the config file.
+
+
+
+ +

+getServerAddress

+
+public static java.net.InetAddress getServerAddress()
+
+
This method returns the inet address of the calendar server. +

+

+ +
Returns:
Returns the calendar server's address .
+
+
+
+ +

+getStringValue

+
+public static java.lang.String getStringValue(java.lang.String sKey)
+
+
This method returns a specific string config value. +

+

+
Parameters:
sKey - Specifies the key of the config value to return. +
Returns:
Returns the requested config value.
+
+
+
+ +

+getIntValue

+
+public static int getIntValue(java.lang.String sKey)
+
+
This method returns a specific integer config value. +

+

+
Parameters:
sKey - Specifies the key of the config value to return. +
Returns:
Returns the requested config value.
+
+
+
+ +

+getBooleanValue

+
+public static boolean getBooleanValue(java.lang.String sKey)
+
+
This method returns a specific boolean config value. +

+

+
Parameters:
sKey - Specifies the key of the config value to return. +
Returns:
Returns the requested config value.
+
+
+
+ +

+getKeySet

+
+public static java.util.Set getKeySet()
+
+
This method returns a set of keys of the config hash map. +

+

+ +
Returns:
Returns a Set object containing all keys of the Config's hash map.
+
+
+
+ +

+setValue

+
+public static void setValue(java.lang.String sKey,
+                            java.lang.String sVal)
+
+
This method changes or adds a specific config value. +

+

+
Parameters:
sKey - Specifies the config key to set or update.
sVal - Specifies the value of the key to set or update.
+
+
+
+ +

+getSortedKeyArray

+
+public static java.lang.String[] getSortedKeyArray()
+
+
This method returns a sorted String array of all available config keys. +

+

+ +
Returns:
Returns a sorted String array of all available config keys.
+
+
+
+ +

+writeConfigToFile

+
+public static void writeConfigToFile()
+
+
This method writes the current configuration to the config file "config.txt". +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/Main.html b/javadoc/shared/Main.html new file mode 100644 index 0000000..8e319a0 --- /dev/null +++ b/javadoc/shared/Main.html @@ -0,0 +1,331 @@ + + + + + + +Main + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +shared +
+Class Main

+
+java.lang.Object
+  extended byshared.Main
+
+
+
+
public final class Main
extends java.lang.Object
+ +

+This class contains the static main method to start the program from. + This class is also responsible for handling info ans status messages and + the logging option of those messages. +

+ +

+

+
Author:
+
buetow
+
+
+ +

+ + + + + + + + + + + + + + + + +
+Constructor Summary
Main() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+static voidexit(int iCode) + +
+          This method is called thenever the server or the client process wants to exit.
+static voidinfoMessage(java.lang.String sMessage) + +
+          All info messages of the calendar client and the calendar server go through this method.
+static voidmain(java.lang.String[] args) + +
+          This method is the start point of the whole program.
+static voidstatusMessage(java.lang.String sMessage) + +
+          This method is for various messages.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+Main

+
+public Main()
+
+
+ + + + + + + + +
+Method Detail
+ +

+main

+
+public static void main(java.lang.String[] args)
+
+
This method is the start point of the whole program. Its initialiting the static Config object + and starts a calendar server and/or a calendar client thread depending on the "server_run" and + "client_run" configuration options. +

+

+
Parameters:
args - Specifies the program arguments (not used yet by the program)
+
+
+
+ +

+infoMessage

+
+public static void infoMessage(java.lang.String sMessage)
+
+
All info messages of the calendar client and the calendar server go through this method. + They are not using System.out.* directly. +

+

+
Parameters:
sMessage - Specifies the program info message.
+
+
+
+ +

+statusMessage

+
+public static void statusMessage(java.lang.String sMessage)
+
+
This method is for various messages. All messages will show up in the status bar of the client's main window. + If there is no main window, the infoMessage method will be used instead. +

+

+
Parameters:
sMessage - Specifies the message to be displayed in the status bar.
+
+
+
+ +

+exit

+
+public static void exit(int iCode)
+
+
This method is called thenever the server or the client process wants to exit. +

+

+
Parameters:
iCode - Specifies the exit code to use for the System.exit call.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/MyDate.html b/javadoc/shared/MyDate.html new file mode 100644 index 0000000..d4d6f64 --- /dev/null +++ b/javadoc/shared/MyDate.html @@ -0,0 +1,298 @@ + + + + + + +MyDate + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +shared +
+Class MyDate

+
+java.lang.Object
+  extended byjava.util.Date
+      extended byshared.MyDate
+
+
+
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, java.io.Serializable
+
+
+
+
public class MyDate
extends java.util.Date
+ +

+This class extends the standard Date class and customizes the toString method. + This class also contains some helper methods to make the life easier. +

+ +

+

+
Author:
+
buetow
+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + + + +
+Constructor Summary
MyDate(java.util.Date date) + +
+           
+  + + + + + + + + + + + + + + + +
+Method Summary
+static java.lang.StringaddZerosToFront(int iValue, + int iWantedLength) + +
+          This method adds zeros in front of a number and returns it as a string.
+ java.lang.StringtoString() + +
+           
+ + + + + + + +
Methods inherited from class java.util.Date
after, before, clone, compareTo, compareTo, equals, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setTime, setYear, toGMTString, toLocaleString, UTC
+ + + + + + + +
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+MyDate

+
+public MyDate(java.util.Date date)
+
+
+ + + + + + + + +
+Method Detail
+ +

+toString

+
+public java.lang.String toString()
+
+
+
See Also:
Object.toString()
+
+
+
+ +

+addZerosToFront

+
+public static java.lang.String addZerosToFront(int iValue,
+                                               int iWantedLength)
+
+
This method adds zeros in front of a number and returns it as a string. +

+

+
Parameters:
iValue - Specifies the number to add zeros to.
iWantedLength - Specifies the wanted max length of the string. +
Returns:
Returns the number represented as a string with additional zeros on front.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/MyVector.html b/javadoc/shared/MyVector.html new file mode 100644 index 0000000..a43f703 --- /dev/null +++ b/javadoc/shared/MyVector.html @@ -0,0 +1,295 @@ + + + + + + +MyVector + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +shared +
+Class MyVector

+
+java.lang.Object
+  extended byjava.util.AbstractCollection
+      extended byjava.util.AbstractList
+          extended byjava.util.Vector
+              extended byshared.MyVector
+
+
+
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable
+
+
+
+
public class MyVector
extends java.util.Vector
+ +

+This class extends the standard Vector class and defined additional help methods. +

+ +

+

+
Author:
+
buetow
+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + + + +
+Constructor Summary
MyVector() + +
+           
+  + + + + + + + + + + + +
+Method Summary
+ voidappendVector(java.util.Vector vecAppend) + +
+          This method appends a vector at the end.
+ + + + + + + +
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
+ + + + + + + +
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
+ + + + + + + +
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
+ + + + + + + +
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+MyVector

+
+public MyVector()
+
+
+ + + + + + + + +
+Method Detail
+ +

+appendVector

+
+public void appendVector(java.util.Vector vecAppend)
+
+
This method appends a vector at the end. +

+

+
Parameters:
vecAppend - Specifies the vector to be appended.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/class-use/CalendarCategory.html b/javadoc/shared/class-use/CalendarCategory.html new file mode 100644 index 0000000..d471e42 --- /dev/null +++ b/javadoc/shared/class-use/CalendarCategory.html @@ -0,0 +1,231 @@ + + + + + + +Uses of Class shared.CalendarCategory + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
shared.CalendarCategory

+
+ + + + + + + + + + + + + +
+Packages that use CalendarCategory
server  
shared  
+  +

+ + + + + +
+Uses of CalendarCategory in server
+  +

+ + + + + + + + + +
Methods in server that return CalendarCategory
+ CalendarCategoryCalendarDatabase.getCategory(java.lang.String sCategoryName) + +
+          Returns a specific calendar category using fast hash lookup.
+  +

+ + + + + +
+Uses of CalendarCategory in shared
+  +

+ + + + + + + + + +
Methods in shared that return CalendarCategory
+ CalendarCategoryCalendarEvent.getCategory() + +
+          This event returns the event's calendar category.
+  +

+ + + + + + + + + +
Methods in shared with parameters of type CalendarCategory
+ voidCalendarEvent.setCategory(CalendarCategory category) + +
+          This method sets the event's category.
+  +

+ + + + + + + + +
Constructors in shared with parameters of type CalendarCategory
CalendarEvent(CalendarCategory category) + +
+          Simple constructor, creates an event object and increments iEventIDCount by one.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/class-use/CalendarEvent.html b/javadoc/shared/class-use/CalendarEvent.html new file mode 100644 index 0000000..6862091 --- /dev/null +++ b/javadoc/shared/class-use/CalendarEvent.html @@ -0,0 +1,335 @@ + + + + + + +Uses of Class shared.CalendarEvent + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
shared.CalendarEvent

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+Packages that use CalendarEvent
client  
client.inputforms  
server  
shared  
shared.remotecall  
+  +

+ + + + + +
+Uses of CalendarEvent in client
+  +

+ + + + + + + + + +
Methods in client that return CalendarEvent
+ CalendarEventCalendarTableModel.getEvent(int iRow) + +
+          This method returns the calendar event which belongs to a specific table row
+  +

+ + + + + + + + + +
Methods in client with parameters of type CalendarEvent
+ voidNetCalendarClient.deleteEvent(CalendarEvent deleteEvent) + +
+          This method tells the calendar server to delete a given calendar event.
+  +

+ + + + + +
+Uses of CalendarEvent in client.inputforms
+  +

+ + + + + + + + +
Constructors in client.inputforms with parameters of type CalendarEvent
EditExistingEvent(NetCalendarClient netCalendarClient, + CalendarEvent originalCalendarEvent) + +
+          Create the input form window and show it.
+  +

+ + + + + +
+Uses of CalendarEvent in server
+  +

+ + + + + + + + + +
Methods in server that return CalendarEvent
+ CalendarEventCalendarDatabase.getEvent(int iEventID) + +
+          Returns a specific calendar event using fast hash lookup.
+  +

+ + + + + +
+Uses of CalendarEvent in shared
+  +

+ + + + + + + + + + + + + +
Methods in shared with parameters of type CalendarEvent
+ voidCalendarCategory.addEvent(CalendarEvent event) + +
+          This method adds an event to the category.
+ voidCalendarCategory.removeEvent(CalendarEvent event) + +
+          This method removes a given event from its event vector.
+  +

+ + + + + +
+Uses of CalendarEvent in shared.remotecall
+  +

+ + + + + + + + + +
Methods in shared.remotecall that return CalendarEvent
+ CalendarEventClientRequest.getEvent() + +
+          This method returns the event object.
+  +

+ + + + + + + + + + + + + +
Methods in shared.remotecall with parameters of type CalendarEvent
+ voidClientRequest.setEvent(CalendarEvent event) + +
+          This method sets a calendar event object to be transfered to the calendar server because the event has been modified.
+ booleanClientRequest.match(CalendarEvent calendarEvent) + +
+          Checks if a specific calendar event matches this client request.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/class-use/Config.html b/javadoc/shared/class-use/Config.html new file mode 100644 index 0000000..82634e5 --- /dev/null +++ b/javadoc/shared/class-use/Config.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Class shared.Config + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
shared.Config

+
+No usage of shared.Config +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/class-use/Main.html b/javadoc/shared/class-use/Main.html new file mode 100644 index 0000000..f70b5f2 --- /dev/null +++ b/javadoc/shared/class-use/Main.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Class shared.Main + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
shared.Main

+
+No usage of shared.Main +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/class-use/MyDate.html b/javadoc/shared/class-use/MyDate.html new file mode 100644 index 0000000..ecfece9 --- /dev/null +++ b/javadoc/shared/class-use/MyDate.html @@ -0,0 +1,172 @@ + + + + + + +Uses of Class shared.MyDate + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
shared.MyDate

+
+ + + + + + + + + +
+Packages that use MyDate
shared  
+  +

+ + + + + +
+Uses of MyDate in shared
+  +

+ + + + + + + + + +
Methods in shared that return MyDate
+ MyDateCalendarEvent.getDate() + +
+          This method returns the event's date object.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/class-use/MyVector.html b/javadoc/shared/class-use/MyVector.html new file mode 100644 index 0000000..c5bd1e6 --- /dev/null +++ b/javadoc/shared/class-use/MyVector.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Class shared.MyVector + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
shared.MyVector

+
+No usage of shared.MyVector +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/package-frame.html b/javadoc/shared/package-frame.html new file mode 100644 index 0000000..24ba596 --- /dev/null +++ b/javadoc/shared/package-frame.html @@ -0,0 +1,42 @@ + + + + + + +shared + + + + + + + + + + + +shared + + + + +
+Classes  + +
+CalendarCategory +
+CalendarEvent +
+Config +
+Main +
+MyDate +
+MyVector
+ + + + diff --git a/javadoc/shared/package-summary.html b/javadoc/shared/package-summary.html new file mode 100644 index 0000000..6c4fa7d --- /dev/null +++ b/javadoc/shared/package-summary.html @@ -0,0 +1,169 @@ + + + + + + +shared + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package shared +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class Summary
CalendarCategoryThis class specifies a category of the calendar events.
CalendarEventThis class specifies calendar events.
ConfigThis class makes all the configuration options available to all the other classes and objects + of this program.
MainThis class contains the static main method to start the program from.
MyDateThis class extends the standard Date class and customizes the toString method.
MyVectorThis class extends the standard Vector class and defined additional help methods.
+  + +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/package-tree.html b/javadoc/shared/package-tree.html new file mode 100644 index 0000000..858f014 --- /dev/null +++ b/javadoc/shared/package-tree.html @@ -0,0 +1,158 @@ + + + + + + +shared Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package shared +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+
    +
  • class java.lang.Object
      +
    • class java.util.AbstractCollection (implements java.util.Collection) +
        +
      • class java.util.AbstractList (implements java.util.List) +
          +
        • class java.util.Vector (implements java.lang.Cloneable, java.util.List, java.util.RandomAccess, java.io.Serializable) + +
        +
      +
    • class shared.CalendarCategory
    • class shared.CalendarEvent (implements java.io.Serializable) +
    • class shared.Config
    • class java.util.Date (implements java.lang.Cloneable, java.lang.Comparable, java.io.Serializable) + +
    • class shared.Main
    +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/package-use.html b/javadoc/shared/package-use.html new file mode 100644 index 0000000..1306a75 --- /dev/null +++ b/javadoc/shared/package-use.html @@ -0,0 +1,256 @@ + + + + + + +Uses of Package shared + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
shared

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+Packages that use shared
client  
client.inputforms  
server  
shared  
shared.remotecall  
+  +

+ + + + + + + + +
+Classes in shared used by client
CalendarEvent + +
+          This class specifies calendar events.
+  +

+ + + + + + + + +
+Classes in shared used by client.inputforms
CalendarEvent + +
+          This class specifies calendar events.
+  +

+ + + + + + + + + + + +
+Classes in shared used by server
CalendarCategory + +
+          This class specifies a category of the calendar events.
CalendarEvent + +
+          This class specifies calendar events.
+  +

+ + + + + + + + + + + + + + +
+Classes in shared used by shared
CalendarCategory + +
+          This class specifies a category of the calendar events.
CalendarEvent + +
+          This class specifies calendar events.
MyDate + +
+          This class extends the standard Date class and customizes the toString method.
+  +

+ + + + + + + + +
+Classes in shared used by shared.remotecall
CalendarEvent + +
+          This class specifies calendar events.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/remotecall/ClientRequest.html b/javadoc/shared/remotecall/ClientRequest.html new file mode 100644 index 0000000..6d6e2de --- /dev/null +++ b/javadoc/shared/remotecall/ClientRequest.html @@ -0,0 +1,794 @@ + + + + + + +ClientRequest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +shared.remotecall +
+Class ClientRequest

+
+java.lang.Object
+  extended byshared.remotecall.RemoteCall
+      extended byshared.remotecall.ClientRequest
+
+
+
All Implemented Interfaces:
java.io.Serializable
+
+
+
+
public final class ClientRequest
extends RemoteCall
implements java.io.Serializable
+ +

+An object of this class is sent from the calendar client to the calendar server each time + a request is made. This class encapsulates all the needed information so that the server can + response with a serialized server response object. +

+ +

+

+
Author:
+
buetow
+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static intADD_EVENT + +
+           
+static intDELETE_EVENT + +
+           
+static intFLUSH_DATABASE + +
+           
+static intMODIFY_EVENT + +
+           
+static intRELOAD_DATABASE + +
+           
+static intREQUEST_ALL_EVENTS + +
+           
+static intREQUEST_EVENTS + +
+           
+static intSHUTDOWN_SERVER + +
+           
+  + + + + + + + + + + + + + +
+Constructor Summary
ClientRequest() + +
+          Simple constructor, creates a client request object requesting events up + from the current date.
ClientRequest(int iAction) + +
+          Simple constructor, creates a client request object requesting events up + from the current date.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ booleanactionIs(int iAction) + +
+          This method is needed by the clanedar server to get the type of action requested.
+ CalendarEventgetEvent() + +
+          This method returns the event object.
+ intgetNumEventsToRequest() + +
+          This method returns the maximum number of events the client wants to request.
+ booleanmatch(CalendarEvent calendarEvent) + +
+          Checks if a specific calendar event matches this client request.
+ booleanrequestsNewEvents() + +
+          This method is needed by the calendar server to get the type of action requested.
+ voidsetDateRange(java.util.Date dateRangeFrom, + java.util.Date dateRangeTo) + +
+          This method sets the date range to request.
+ voidsetEvent(CalendarEvent event) + +
+          This method sets a calendar event object to be transfered to the calendar server because the event has been modified.
+ voidsetMainRegexp(boolean bMainRegexp) + +
+          This method sets if the client contains a regexp from the main session window.
+ voidsetNumEventsToRequest(int iNumEvents) + +
+          With this method the client can define the maximum number of events to request.
+ voidsetRegexpAll(java.lang.String sRegexp) + +
+          This method compiles a specific pattern object to match with on the server part after serialization.
+ voidsetRegexpCategory(java.lang.String sRegexp) + +
+          This method compiles a specific pattern object to match with on the server part after serialization.
+ voidsetRegexpDate(java.lang.String sRegexp) + +
+          This method compiles a specific pattern object to match with on the server part after serialization.
+ voidsetRegexpDescription(java.lang.String sRegexp) + +
+          This method compiles a specific pattern object to match with on the server part after serialization.
+ voidsetRegexpPlace(java.lang.String sRegexp) + +
+          This method compiles a specific pattern object to match with on the server part after serialization.
+ java.lang.StringtoString() + +
+          This method returns a representation the object as a string.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+REQUEST_EVENTS

+
+public static final int REQUEST_EVENTS
+
+
+
See Also:
Constant Field Values
+
+
+ +

+REQUEST_ALL_EVENTS

+
+public static final int REQUEST_ALL_EVENTS
+
+
+
See Also:
Constant Field Values
+
+
+ +

+MODIFY_EVENT

+
+public static final int MODIFY_EVENT
+
+
+
See Also:
Constant Field Values
+
+
+ +

+DELETE_EVENT

+
+public static final int DELETE_EVENT
+
+
+
See Also:
Constant Field Values
+
+
+ +

+ADD_EVENT

+
+public static final int ADD_EVENT
+
+
+
See Also:
Constant Field Values
+
+
+ +

+RELOAD_DATABASE

+
+public static final int RELOAD_DATABASE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+FLUSH_DATABASE

+
+public static final int FLUSH_DATABASE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+SHUTDOWN_SERVER

+
+public static final int SHUTDOWN_SERVER
+
+
+
See Also:
Constant Field Values
+
+ + + + + + + + +
+Constructor Detail
+ +

+ClientRequest

+
+public ClientRequest()
+
+
Simple constructor, creates a client request object requesting events up + from the current date. +

+

+
+ +

+ClientRequest

+
+public ClientRequest(int iAction)
+
+
Simple constructor, creates a client request object requesting events up + from the current date. +

+

Parameters:
iAction - Specifies the request type of this request.
+ + + + + + + + +
+Method Detail
+ +

+actionIs

+
+public boolean actionIs(int iAction)
+
+
This method is needed by the clanedar server to get the type of action requested. +

+

+
+
+
+
Parameters:
iAction - Specifies the action to test against. +
Returns:
Returns true if the specified action ID matches with the action ID of this request object.
+
+
+
+ +

+requestsNewEvents

+
+public boolean requestsNewEvents()
+
+
This method is needed by the calendar server to get the type of action requested. +

+

+
+
+
+ +
Returns:
Returns true if this object requests new events from the server.
+
+
+
+ +

+setDateRange

+
+public void setDateRange(java.util.Date dateRangeFrom,
+                         java.util.Date dateRangeTo)
+
+
This method sets the date range to request. +

+

+
+
+
+
Parameters:
dateRangeFrom - Specifies the beginning date.
dateRangeTo - Specifies the ending date.
+
+
+
+ +

+setEvent

+
+public void setEvent(CalendarEvent event)
+
+
This method sets a calendar event object to be transfered to the calendar server because the event has been modified. +

+

+
+
+
+
Parameters:
event - Specifies an event to be transfered to the calendar server.
+
+
+
+ +

+getEvent

+
+public CalendarEvent getEvent()
+
+
This method returns the event object. +

+

+
+
+
+ +
Returns:
Returns the calendar event which is stored inside this client request.
+
+
+
+ +

+setNumEventsToRequest

+
+public void setNumEventsToRequest(int iNumEvents)
+
+
With this method the client can define the maximum number of events to request. +

+

+
+
+
+
Parameters:
iNumEvents - Specifies the maximum number of events to request.
+
+
+
+ +

+getNumEventsToRequest

+
+public int getNumEventsToRequest()
+
+
This method returns the maximum number of events the client wants to request. +

+

+
+
+
+ +
Returns:
Returns the maximum number of events the client wants to request.
+
+
+
+ +

+setMainRegexp

+
+public void setMainRegexp(boolean bMainRegexp)
+
+
This method sets if the client contains a regexp from the main session window. +

+

+
+
+
+
Parameters:
bMainRegexp - Set to true if the user used the main regexp field of the main GUI window.
+
+
+
+ +

+setRegexpAll

+
+public void setRegexpAll(java.lang.String sRegexp)
+
+
This method compiles a specific pattern object to match with on the server part after serialization. +

+

+
+
+
+
Parameters:
sRegexp - Compiles a Pattern object with sRegexp as the regular expression.
+
+
+
+ +

+setRegexpCategory

+
+public void setRegexpCategory(java.lang.String sRegexp)
+
+
This method compiles a specific pattern object to match with on the server part after serialization. +

+

+
+
+
+
Parameters:
sRegexp - Compiles a Pattern object with sRegexp as the regular expression.
+
+
+
+ +

+setRegexpDescription

+
+public void setRegexpDescription(java.lang.String sRegexp)
+
+
This method compiles a specific pattern object to match with on the server part after serialization. +

+

+
+
+
+
Parameters:
sRegexp - Compiles a Pattern object with sRegexp as the regular expression.
+
+
+
+ +

+setRegexpPlace

+
+public void setRegexpPlace(java.lang.String sRegexp)
+
+
This method compiles a specific pattern object to match with on the server part after serialization. +

+

+
+
+
+
Parameters:
sRegexp - Compiles a Pattern object with sRegexp as the regular expression.
+
+
+
+ +

+setRegexpDate

+
+public void setRegexpDate(java.lang.String sRegexp)
+
+
This method compiles a specific pattern object to match with on the server part after serialization. +

+

+
+
+
+
Parameters:
sRegexp - Compiles a Pattern object with sRegexp as the regular expression.
+
+
+
+ +

+match

+
+public boolean match(CalendarEvent calendarEvent)
+
+
Checks if a specific calendar event matches this client request. +

+

+
+
+
+
Parameters:
calendarEvent - Specifies the event to match against. +
Returns:
Returns true if the given event matched. Else, false will be returned.
+
+
+
+ +

+toString

+
+public java.lang.String toString()
+
+
This method returns a representation the object as a string. +

+

+
+
+
+ +
Returns:
Returns the object represented as a string.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/remotecall/RemoteCall.html b/javadoc/shared/remotecall/RemoteCall.html new file mode 100644 index 0000000..ed3fefa --- /dev/null +++ b/javadoc/shared/remotecall/RemoteCall.html @@ -0,0 +1,232 @@ + + + + + + +RemoteCall + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +shared.remotecall +
+Class RemoteCall

+
+java.lang.Object
+  extended byshared.remotecall.RemoteCall
+
+
+
Direct Known Subclasses:
ClientRequest, ServerResponse
+
+
+
+
public abstract class RemoteCall
extends java.lang.Object
+ +

+This is the abstract base class of all other classes of the shared.remotecall package. + Its defining some common methods. +

+ +

+

+
Author:
+
buetow
+
+
+ +

+ + + + + + + + + + + + + + + + +
+Constructor Summary
RemoteCall() + +
+           
+  + + + + + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+RemoteCall

+
+public RemoteCall()
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/remotecall/ServerResponse.html b/javadoc/shared/remotecall/ServerResponse.html new file mode 100644 index 0000000..dcfd482 --- /dev/null +++ b/javadoc/shared/remotecall/ServerResponse.html @@ -0,0 +1,273 @@ + + + + + + +ServerResponse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +shared.remotecall +
+Class ServerResponse

+
+java.lang.Object
+  extended byshared.remotecall.RemoteCall
+      extended byshared.remotecall.ServerResponse
+
+
+
All Implemented Interfaces:
java.io.Serializable
+
+
+
+
public final class ServerResponse
extends RemoteCall
implements java.io.Serializable
+ +

+This class represents a server response. A server response will sent from the calendar + server to the calendar client if the client has sent a client request. +

+ +

+

+
Author:
+
buetow
+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + + + +
+Constructor Summary
ServerResponse(java.util.Vector vecEvents) + +
+          Simple constructor, creates a server response which can be sent to the calendar client.
+  + + + + + + + + + + + +
+Method Summary
+ java.util.VectorgetEvents() + +
+          This method returns a vector of all requested calendar events.
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+ServerResponse

+
+public ServerResponse(java.util.Vector vecEvents)
+
+
Simple constructor, creates a server response which can be sent to the calendar client. +

+

Parameters:
vecEvents - Specifies all calendar events to be sent to the calendar client.
+ + + + + + + + +
+Method Detail
+ +

+getEvents

+
+public java.util.Vector getEvents()
+
+
This method returns a vector of all requested calendar events. +

+

+
+
+
+ +
Returns:
Returns a Vector of all requested CalendarEvent objects.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/remotecall/class-use/ClientRequest.html b/javadoc/shared/remotecall/class-use/ClientRequest.html new file mode 100644 index 0000000..f465d3f --- /dev/null +++ b/javadoc/shared/remotecall/class-use/ClientRequest.html @@ -0,0 +1,263 @@ + + + + + + +Uses of Class shared.remotecall.ClientRequest + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
shared.remotecall.ClientRequest

+
+ + + + + + + + + + + + + + + + + +
+Packages that use ClientRequest
client  
server  
shared  
+  +

+ + + + + +
+Uses of ClientRequest in client
+  +

+ + + + + + + + + + + + + +
Methods in client with parameters of type ClientRequest
+static ServerResponseServerRequester.sendClientRequest(ClientRequest clientRequest) + +
+          Sends a client request to the netcalendar server end receives a server response object.
+ voidNetCalendarClient.update(ClientRequest clientRequest) + +
+          This method sends a client request object to the server and used the server response object + to update the JTable ith its new values using the table model.
+  +

+ + + + + +
+Uses of ClientRequest in server
+  +

+ + + + + + + + + + + + + + + + + + + + + +
Methods in server with parameters of type ClientRequest
+ java.util.VectorCalendarDatabase.getMatchingEvents(ClientRequest clientRequest) + +
+          This method looks for all calendar events which match the a given client request.
+ voidCalendarDatabase.addEvent(ClientRequest clientRequest) + +
+          This method adds a calendar event to the calendar database.
+ voidCalendarDatabase.modifyEvent(ClientRequest clientRequest) + +
+          This method modifies an calendar event of the calendar database.
+ voidCalendarDatabase.deleteEvent(ClientRequest clientRequest) + +
+          This method deletes a calendar event of the calendar database.
+  +

+ + + + + +
+Uses of ClientRequest in shared
+  +

+ + + + + + + + + +
Methods in shared with parameters of type ClientRequest
+ java.util.VectorCalendarCategory.getMatchingEvents(ClientRequest clientRequest) + +
+          This method looks for all calendar events of this category which matches a given client's request.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/remotecall/class-use/RemoteCall.html b/javadoc/shared/remotecall/class-use/RemoteCall.html new file mode 100644 index 0000000..f8fc148 --- /dev/null +++ b/javadoc/shared/remotecall/class-use/RemoteCall.html @@ -0,0 +1,181 @@ + + + + + + +Uses of Class shared.remotecall.RemoteCall + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
shared.remotecall.RemoteCall

+
+ + + + + + + + + +
+Packages that use RemoteCall
shared.remotecall  
+  +

+ + + + + +
+Uses of RemoteCall in shared.remotecall
+  +

+ + + + + + + + + + + + + +
Subclasses of RemoteCall in shared.remotecall
+ classClientRequest + +
+          An object of this class is sent from the calendar client to the calendar server each time + a request is made.
+ classServerResponse + +
+          This class represents a server response.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/remotecall/class-use/ServerResponse.html b/javadoc/shared/remotecall/class-use/ServerResponse.html new file mode 100644 index 0000000..3aaf152 --- /dev/null +++ b/javadoc/shared/remotecall/class-use/ServerResponse.html @@ -0,0 +1,188 @@ + + + + + + +Uses of Class shared.remotecall.ServerResponse + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
shared.remotecall.ServerResponse

+
+ + + + + + + + + +
+Packages that use ServerResponse
client  
+  +

+ + + + + +
+Uses of ServerResponse in client
+  +

+ + + + + + + + + +
Methods in client that return ServerResponse
+static ServerResponseServerRequester.sendClientRequest(ClientRequest clientRequest) + +
+          Sends a client request to the netcalendar server end receives a server response object.
+  +

+ + + + + + + + + +
Methods in client with parameters of type ServerResponse
+ voidNetCalendarClient.update(ServerResponse serverResponse) + +
+          This method updates the GUI unsing a given server response object.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/remotecall/package-frame.html b/javadoc/shared/remotecall/package-frame.html new file mode 100644 index 0000000..fc742e8 --- /dev/null +++ b/javadoc/shared/remotecall/package-frame.html @@ -0,0 +1,36 @@ + + + + + + +shared.remotecall + + + + + + + + + + + +shared.remotecall + + + + +
+Classes  + +
+ClientRequest +
+RemoteCall +
+ServerResponse
+ + + + diff --git a/javadoc/shared/remotecall/package-summary.html b/javadoc/shared/remotecall/package-summary.html new file mode 100644 index 0000000..c0061f1 --- /dev/null +++ b/javadoc/shared/remotecall/package-summary.html @@ -0,0 +1,157 @@ + + + + + + +shared.remotecall + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package shared.remotecall +

+ + + + + + + + + + + + + + + + + +
+Class Summary
ClientRequestAn object of this class is sent from the calendar client to the calendar server each time + a request is made.
RemoteCallThis is the abstract base class of all other classes of the shared.remotecall package.
ServerResponseThis class represents a server response.
+  + +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/remotecall/package-tree.html b/javadoc/shared/remotecall/package-tree.html new file mode 100644 index 0000000..73cb686 --- /dev/null +++ b/javadoc/shared/remotecall/package-tree.html @@ -0,0 +1,149 @@ + + + + + + +shared.remotecall Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package shared.remotecall +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+
    +
  • class java.lang.Object
      +
    • class shared.remotecall.RemoteCall
        +
      • class shared.remotecall.ClientRequest (implements java.io.Serializable) +
      • class shared.remotecall.ServerResponse (implements java.io.Serializable) +
      +
    +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/shared/remotecall/package-use.html b/javadoc/shared/remotecall/package-use.html new file mode 100644 index 0000000..b3f646c --- /dev/null +++ b/javadoc/shared/remotecall/package-use.html @@ -0,0 +1,228 @@ + + + + + + +Uses of Package shared.remotecall + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
shared.remotecall

+
+ + + + + + + + + + + + + + + + + + + + + +
+Packages that use shared.remotecall
client  
server  
shared  
shared.remotecall  
+  +

+ + + + + + + + + + + +
+Classes in shared.remotecall used by client
ClientRequest + +
+          An object of this class is sent from the calendar client to the calendar server each time + a request is made.
ServerResponse + +
+          This class represents a server response.
+  +

+ + + + + + + + +
+Classes in shared.remotecall used by server
ClientRequest + +
+          An object of this class is sent from the calendar client to the calendar server each time + a request is made.
+  +

+ + + + + + + + +
+Classes in shared.remotecall used by shared
ClientRequest + +
+          An object of this class is sent from the calendar client to the calendar server each time + a request is made.
+  +

+ + + + + + + + +
+Classes in shared.remotecall used by shared.remotecall
RemoteCall + +
+          This is the abstract base class of all other classes of the shared.remotecall package.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/javadoc/stylesheet.css b/javadoc/stylesheet.css new file mode 100644 index 0000000..6d31fdb --- /dev/null +++ b/javadoc/stylesheet.css @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF } + +/* Headings */ +h1 { font-size: 145% } + +/* Table colors */ +.TableHeadingColor { background: #CCCCFF } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ +.TableRowColor { background: #FFFFFF } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} + diff --git a/netcalendar.log b/netcalendar.log new file mode 100644 index 0000000..e69de29 diff --git a/server/CalendarDatabase.java b/server/CalendarDatabase.java new file mode 100644 index 0000000..50caecb --- /dev/null +++ b/server/CalendarDatabase.java @@ -0,0 +1,271 @@ +package server; + +import java.util.*; + +import shared.*; +import shared.remotecall.*; + +/** + * A object of this class encapsulates the whole calendar database on the server side. + * This class is used for getting/modifying and adding/removing of calendar events. + * @author buetow + * + */ +public final class CalendarDatabase { + private Vector vecCategories; + private HashMap mapEvents; + private HashMap mapCategories; + + /** + * Simple constructur. Creates a calendar database. + * @param vecCategories Specifies the vector of CalendarCategory objects for initial database content. + */ + public CalendarDatabase(Vector vecCategories) { + this.vecCategories = vecCategories; + initializeMaps(); + } + + /** + * Initializes a private hash map so that the server can access events by their id numbers very fast. + */ + private void initializeMaps() { + this.mapEvents = new HashMap(); + this.mapCategories = new HashMap(); + + Enumeration enumCategory = vecCategories.elements(); + while (enumCategory.hasMoreElements()) { + CalendarCategory category = (CalendarCategory) enumCategory.nextElement(); + mapCategories.put(category.getName(), category); + + Vector vecEvents = category.getEvents(); + Enumeration enumEvents = vecEvents.elements(); + while (enumEvents.hasMoreElements()) { + CalendarEvent event = (CalendarEvent) enumEvents.nextElement(); + mapEvents.put(new Integer(event.getEventID()), event); + } + } + } + + /** + * Returns a specific calendar event using fast hash lookup. + * @param iEventID Specifies the ID of the calendar event to lookup. + * @return Returns the requested calendar event. + */ + public CalendarEvent getEvent(int iEventID) { + return (CalendarEvent) mapEvents.get(new Integer(iEventID)); + } + + /** + * Returns a specific calendar category using fast hash lookup. + * @param sCategoryName Specifies the name of the calendar category to lookup. + * @return Returns the requested calendar category. + */ + public CalendarCategory getCategory(String sCategoryName) { + return (CalendarCategory) mapCategories.get(sCategoryName); + } + + /** + * Gets all calendar categories. + * @return Returns a Vector of all available CalendarCategory objects. + */ + public Vector getCategories() { + return vecCategories; + } + + /** + * This method returns a Vector of all available calendar events. + * @return Returns all available CalendarEvent objects of the database. + */ + public Vector getAllEvents() { + MyVector vecAllEvents = new MyVector(); + Enumeration enumCategories = vecCategories.elements(); + + while (enumCategories.hasMoreElements()) { + CalendarCategory category = (CalendarCategory) enumCategories.nextElement(); + vecAllEvents.appendVector(category.getEvents()); + } + + return vecAllEvents; + } + + /** + * This method looks for all calendar events which match the a given client request. + * @param clientRequest Specifies the client request sent by the calendar client. + * @return Returns a Vector of all matching CalendarEvent objects. + */ + public Vector getMatchingEvents(ClientRequest clientRequest) { + MyVector vecEvents = new MyVector(); + int iNumEventsToRequest = clientRequest.getNumEventsToRequest(); + + Enumeration enumCategories = vecCategories.elements(); + while (enumCategories.hasMoreElements()) { + CalendarCategory category = (CalendarCategory) enumCategories.nextElement(); + Vector vecNewEvents = category.getMatchingEvents(clientRequest); + vecEvents.appendVector(vecNewEvents); + + if (iNumEventsToRequest > -1) { + if (iNumEventsToRequest == vecEvents.size()) + break; + + } else { + clientRequest.setNumEventsToRequest(iNumEventsToRequest - vecNewEvents.size()); + } + + } + + return vecEvents; + } + + /** + * This method adds a calendar event to the calendar database. + * @param clientRequest Specifies the client request sent by the netcalendar client. Its containing the new event to add. + */ + public void addEvent(ClientRequest clientRequest) { + CalendarEvent event = clientRequest.getEvent(); + String sCategoryName = event.getCategoryName(); + CalendarCategory category = getCategory(sCategoryName); + + // Check if the have to create a new category + if (category == null) { + category = new CalendarCategory(sCategoryName); + mapCategories.put(sCategoryName, category); + vecCategories.add(category); + } + + category.addEvent(event); + category.setHasChanged(true); + event.setCategory(category); + mapEvents.put(new Integer(event.getEventID()), event); + } + + /** + * This method modifies an calendar event of the calendar database. + * @param clientRequest Specifies the client request sent by the calendar client. + */ + public void modifyEvent(ClientRequest clientRequest) { + CalendarEvent newEvent = clientRequest.getEvent(); + CalendarEvent orgEvent = getEvent(newEvent.getEventID()); + + // If the event doesnt exist any more, recreate it + if (orgEvent == null) { + clientRequest.setEvent(newEvent); + addEvent(clientRequest); + return; + } + + orgEvent.setDate(newEvent.getDate()); + orgEvent.setYearly(newEvent.isYearly()); + orgEvent.setDescription(newEvent.getDescription()); + orgEvent.setPlace(newEvent.getPlace()); + + // Modify the events category + if (!orgEvent.getCategoryName().equals(newEvent.getCategoryName())) { + String sNewCategoryName = newEvent.getCategoryName(); + + // First remove the event from its current category + orgEvent.removeFromCurrentCategory(); + CalendarCategory category = getCategory(sNewCategoryName); + + if (category == null) { + category = new CalendarCategory(sNewCategoryName); + mapCategories.put(sNewCategoryName, category); + vecCategories.add(category); + } + + category.addEvent(orgEvent); + category.setHasChanged(true); + orgEvent.setCategory(category); + + } else { + orgEvent.getCategory().setHasChanged(true); + } + } + + /** + * This method deletes a calendar event of the calendar database. If the specified calendar event doesnt + * exist eny more, nothing will be changed. + * @param clientRequest Specifies the client request sent by the netcalendar client. + */ + public void deleteEvent(ClientRequest clientRequest) { + // Get the server side reference of the calendar event + CalendarEvent event = getEvent(clientRequest.getEvent().getEventID()); + + if (event != null) { + event.getCategory().setHasChanged(true); + event.removeFromCurrentCategory(); + mapEvents.remove(new Integer(event.getEventID())); + } + } + + /** + * This method renames a calendar category. + * @param clientRequest Specifies the client request sent by the netcalendar client. + */ + public void renameCategory(ClientRequest clientRequest) { + String sOldCategoryName = clientRequest.getEvent().getCategoryName(); + CalendarCategory category = getCategory(sOldCategoryName); + + if (category == null) + return; + + String sNewCategoryName = clientRequest.getString(); + + if (sOldCategoryName.equals(sNewCategoryName)) + return; + + mapCategories.remove(sOldCategoryName); + + category.setName(sNewCategoryName); + + Vector vecEvents = category.getEvents(); + Enumeration enumEvents = vecEvents.elements(); + while (enumEvents.hasMoreElements()) { + CalendarEvent event = (CalendarEvent) enumEvents.nextElement(); + event.setCategoryName(sNewCategoryName); + } + + // Check if the category exists already + CalendarCategory categoryExists = getCategory(sNewCategoryName); + + if (categoryExists == null) { + mapCategories.put(category.getName(), category); + } else { + vecCategories.remove(category); + categoryExists.merge(category); + } + + } + + /** + * This method daletes a calendar category. + * @param clientRequest Specifies the client request sent by the netcalendar client. + */ + public void deleteCategory(ClientRequest clientRequest) { + String sCategoryName = clientRequest.getEvent().getCategoryName(); + CalendarCategory category = getCategory(sCategoryName); + + if (category == null) + return; + + mapCategories.remove(sCategoryName); + vecCategories.remove(category); + category.deleteDatabaseFile(); + } + + /** + * This method flushes all the changed calendar categories of the calendar database to the filesystem. + */ + public void flush() { + Enumeration enumCategories = vecCategories.elements(); + + while (enumCategories.hasMoreElements()) { + CalendarCategory category = (CalendarCategory) enumCategories.nextElement(); + if (category.hasChanged()) + category.flush(); + } + + Main.execExternalCommand(Config.getStringValue("server_updatedb_command")); + } + +} + diff --git a/server/CalendarFormatParser.java b/server/CalendarFormatParser.java new file mode 100644 index 0000000..4ef6fe5 --- /dev/null +++ b/server/CalendarFormatParser.java @@ -0,0 +1,269 @@ +/** + * + */ +package server; + +import java.util.*; +import java.util.regex.*; +import java.text.*; +import java.io.*; + +import shared.*; + +/** + * This class is needed for parsing the original UNIX calendar database format. + * Its parsing the calendar database from the file-system and its caching it into the + * memory. Then, the CalendarDatabase class can be used to access the database. + * Each calendar category has its own file. In each file all the calendar events of the + * specific categories are stored. + * @author buetow + * + */ +public final class CalendarFormatParser { + private int iCurrentYear; + private Date dateCurrent; + private String sWorkdir; + private Vector vecCategories; + private static final Pattern datePattern; + private static final Pattern dateYearlyPattern; + private static final Pattern dateEndPattern; + // private static final Pattern emptyLine; + private static final String DATE_FORMAT = "M/d-y"; + private static final String EXTENDED_DATE_FORMAT = "M/d-y-H:m"; + + // Those pattern will be used later, precompile here once to use often + static { + // Matches calendar date format like: "01/25 2006-14:23" + datePattern = Pattern.compile("\\d{2}/\\d{2}\t\\d{4}-\\d{2}:\\d{2}"); + + // Matches calendar date format like: "01/25 yearly-14:23" + dateYearlyPattern = Pattern.compile("\\d{2}/\\d{2}\tyearly-\\d{2}:\\d{2}"); + + // Matches the end of the date string like: "arly-14:23 " or "2006-14:23" + dateEndPattern = Pattern.compile(".{4}-\\d{2}:\\d{2}"); + } + + /** + * Simple constructor. Creates a calendar format parser object and initializes some private members. + */ + public CalendarFormatParser() { + // Use current dir as workdir by default + this.sWorkdir = "."; + this.vecCategories = new Vector(); + + // Events without a year specified will use the current year! + GregorianCalendar cal = new GregorianCalendar(); + iCurrentYear = cal.get(Calendar.YEAR); + + dateCurrent = new Date(); + } + + /** + * This method returns a vector of all found calendar categories after parsing. + * @return Returns a Vector of all available CalendarCategory objects. + */ + public Vector getCategories() { + return vecCategories; + } + + /** + * This method sets the working directory. Its the "server_database_dir" variable defined in the current configuration by default. + * @param sWorkdir Specifies the working directory. + */ + public void setWorkdir(String sWorkdir) { + this.sWorkdir = sWorkdir; + } + + /** + * Starts the parsing work of the calendar database files. + */ + public void start() { + lookForCategories(); + parseAllCategories(); + Main.execExternalCommand(Config.getStringValue("server_startup_command")); + } + + /** + * Parses for the available calendar categories. + */ + private void lookForCategories() { + File dir = new File(sWorkdir); + File[] dirContent = dir.listFiles(); + + for (int i = 0; i < dirContent.length; ++i) + if (dirContent[i].isFile()) + // Ignore the 'calendar' file, only read the 'calendar.*' files + if (!dirContent[i].getName().equals("calendar")) + vecCategories.add(new CalendarCategory(dirContent[i])); + } + + /** + * Parses all events of all available categories. + */ + private void parseAllCategories() { + Enumeration enumCategories = vecCategories.elements(); + while (enumCategories.hasMoreElements()) + parseCategory((CalendarCategory) enumCategories.nextElement()); + } + + /** + * Parses all events of a category file. + * @param category Specifies the calendar category to be parsed. + */ + private void parseCategory(CalendarCategory category) { + Vector vecEvents = new Vector(); + File file = category.getFile(); + + try { + BufferedReader in = new BufferedReader(new FileReader(file)); + String sLine; + + while ((sLine = in.readLine()) != null) { + CalendarEvent event = new CalendarEvent(category); + + // Ignore empty lines! + if (sLine.equals("")) + continue; + + setEventsDate(event, sLine); + setEventsPlace(event, sLine); + setEventsDescription(event, sLine); + + vecEvents.add(event); + } + + } catch (Exception e) { + Main.infoMessage("Error: " + e.toString()); + } + + category.setEvents(vecEvents); + category.unsetFile(); + } + + /** + * This method parses all known informations from a given calendar format line and saves them + * into the given calendar event object. + * @param event Specifies the calendar event to be modified. + * @param sLine Specifies the single line of the category file to be parsed. + */ + private void setEventsDate(CalendarEvent event, String sLine) { + // Create a local copy because the string may be modified + String sMyLine = new String(sLine).replaceAll(" ", ""); + String sDateFormat; + boolean bValidDateFormat = false; + + // Check if its a yearly event + Matcher matcher = dateYearlyPattern.matcher(sMyLine); + if (matcher.find()) { + sMyLine = sMyLine.replaceFirst("\tyearly", "-" + iCurrentYear); + sDateFormat = EXTENDED_DATE_FORMAT; + event.setYearly(true); + bValidDateFormat = true; + + } else { + // Event is not yearly, but check if its still using NetCalendars + // extended format which contains the event's time (hours:minutes) + matcher = datePattern.matcher(sMyLine); + if (matcher.find()) { + sMyLine = sMyLine.replaceFirst("\t", "-"); + sDateFormat = EXTENDED_DATE_FORMAT; + event.setYearly(false); + bValidDateFormat = true; + + } else { + // Just use original Calendar format without any year and time + // informations + // Assume yearly + sMyLine = sMyLine.replaceFirst("\t", "-" + iCurrentYear); + sDateFormat = DATE_FORMAT; + event.setYearly(true); + bValidDateFormat = true; + } + } + + // Create a new date object containing the events time informations + SimpleDateFormat formatter = new SimpleDateFormat(sDateFormat); + Date date = null; + + if (bValidDateFormat) { + try { + date = formatter.parse(sMyLine); + + } catch (ParseException e) { + Main.infoMessage("Error: Calendar format parser error at category " + + event.getCategoryName() + ": " + e.getMessage()); + } + } + + // The event is yearly, but occured already this year, so increment the events + // year by one! + if (event.isYearly() && date.getTime() < dateCurrent.getTime()) { + Calendar calendar = new GregorianCalendar(); + calendar.setTime(date); + calendar.set(Calendar.YEAR, iCurrentYear + 1); + date = calendar.getTime(); + } + + event.setDate(date); + } + + /** + * Parses a single calendar line for the place information. + * @param event Specifies the calendar event to be modified. + * @param sLine Specifies the single line of the category file to be parsed. + */ + private void setEventsPlace(CalendarEvent event, String sLine) { + int iPos = sLine.indexOf(";;"); + + // No event! Return empty string! + if (iPos < 0) { + event.setPlace(""); + + } else { + event.setPlace(trim(sLine.substring(iPos + 2))); + } + } + + /** + * Parses a single calendar line for the description information. + * @param event Specifies the calendar event to be modified. + * @param sLine Specifies the single line of the category file to be parsed. + */ + private void setEventsDescription(CalendarEvent event, String sLine) { + // We need a local copy because we may modify the string + String sTmp = new String(sLine); + + // Check if there is a place string... + int iPos = sLine.indexOf(";;"); + + // ... if yes, dont include it! + if (iPos >= 0) + sTmp = sTmp.substring(0, iPos); + + // Remove the events date from the string + Matcher matcher = dateEndPattern.matcher(sTmp); + + if (matcher.find()) { + sTmp = sTmp.substring(matcher.start()+11); + + } else { + sTmp = sTmp.substring(sTmp.indexOf("\t")+1); + } + + event.setDescription(trim(sTmp)); + } + + /** + * Its like String.trim() but also removes a ending newline. + * @param sTrimString Specifies the String to be trimmed. + * @return Returns a copy of the string, with leading and trailing whitespace omitted, also a trailing newline will be omitted. + */ + private String trim(String sTrimString) { + int iPos = sTrimString.indexOf("\n"); + + if (iPos >= 0) + return sTrimString.substring(0, iPos).trim(); + + return sTrimString.trim(); + } +} diff --git a/server/NetCalendarServer.java b/server/NetCalendarServer.java new file mode 100644 index 0000000..10704c0 --- /dev/null +++ b/server/NetCalendarServer.java @@ -0,0 +1,160 @@ +/** + * + */ +package server; + +import java.io.*; +import java.net.*; +import java.util.*; +import javax.net.*; +import javax.net.ssl.*; + +import shared.*; +import shared.remotecall.*; + +/** + * This is the main class of the server part of the netcalendar suite. + * It contains the server socket part and hold a references to the calendar database. + * @author buetow + */ +public class NetCalendarServer extends Thread { + private int iPort; + private String sWorkdir; + + /** + * Creates a NetCalendarServer instance and runs it as a thread. + * @param iPort Specifies the server port of the server to be used. + * @param sWorkdir Specifies the working directory of the server. + */ + public NetCalendarServer(int iPort, String sWorkdir) { + this.iPort = iPort; + this.sWorkdir = sWorkdir; + + start(); + } + + /** + * This method initializes a new server socket. + * @return Returns the server socket object. + */ + private ServerSocket makeServerSocket() throws IOException { + if (!Config.getBooleanValue("use_ssl")) + return new ServerSocket(iPort); + + ServerSocketFactory sslSocketFactory = SSLServerSocketFactory.getDefault(); + return sslSocketFactory.createServerSocket(iPort); + } + + /** + * This method specifies the start method of the Thread. Its setting up the server port. + */ + public void run() { + ServerSocket serverSocket = null; + Socket socket = null; + + // Read and parse the whole calendar database from file! + CalendarFormatParser parser = new CalendarFormatParser(); + parser.setWorkdir(sWorkdir); + parser.start(); + + CalendarDatabase calendarDatabase = new CalendarDatabase(parser.getCategories()); + + try { + serverSocket = makeServerSocket(); + + while (true) { + // This will wait for a connection to be made to this socket. + socket = serverSocket.accept(); + // serverSocket.accept(); + socket.setKeepAlive(true); + + // Recieve the client's request object + InputStream inputStream = socket.getInputStream(); + ObjectInput objectInput = new ObjectInputStream(inputStream); + ClientRequest clientRequest = (ClientRequest) objectInput.readObject(); + + if (!clientRequest.checkPassphrase(Config.getStringValue("passphrase", false))) { + Main.infoMessage("Server: Client refused, wrong passphrase!"); + + // Check if a event has been modified! + } else if (clientRequest.requestsNewEvents()) { + Main.infoMessage("Server: Client requests new events"); + + // Get all calendar events which match the request + Vector vecEvents = calendarDatabase.getMatchingEvents(clientRequest); + ServerResponse serverResponse = new ServerResponse(vecEvents); + + OutputStream outputStream = socket.getOutputStream(); + ObjectOutput objectOutput = new ObjectOutputStream(outputStream); + objectOutput.writeObject(serverResponse); + objectOutput.flush(); + objectOutput.close(); + + } else if (clientRequest.actionIs(ClientRequest.MODIFY_EVENT)) { + Main.infoMessage("Server: Client wants to modify an event"); + calendarDatabase.modifyEvent(clientRequest); + // if (Config.getBooleanValue("client_run")) + calendarDatabase.flush(); + + } else if (clientRequest.actionIs(ClientRequest.DELETE_EVENT)) { + Main.infoMessage("Server: Client wants to delete an event"); + calendarDatabase.deleteEvent(clientRequest); + // if (Config.getBooleanValue("client_run")) + calendarDatabase.flush(); + + } else if (clientRequest.actionIs(ClientRequest.ADD_EVENT)) { + Main.infoMessage("Server: Client wants to add an event"); + calendarDatabase.addEvent(clientRequest); + // if (Config.getBooleanValue("client_run")) + calendarDatabase.flush(); + + } else if (clientRequest.actionIs(ClientRequest.RENAME_CATEGORY)) { + Main.infoMessage("Server: Client wants to rename a category"); + calendarDatabase.renameCategory(clientRequest); + // if (Config.getBooleanValue("client_run")) + calendarDatabase.flush(); + + } else if (clientRequest.actionIs(ClientRequest.DELETE_CATEGORY)) { + Main.infoMessage("Server: Client wants to delete a category (NYI)"); + calendarDatabase.deleteCategory(clientRequest); + // if (Config.getBooleanValue("client_run")) + calendarDatabase.flush(); + + } else if (clientRequest.actionIs(ClientRequest.RELOAD_DATABASE)) { + // Read and parse the whole calendar database from file! + parser = new CalendarFormatParser(); + parser.setWorkdir(sWorkdir); + parser.start(); + + calendarDatabase = new CalendarDatabase(parser.getCategories()); + + } else if (clientRequest.actionIs(ClientRequest.FLUSH_DATABASE)) { + Main.infoMessage("Server: Client wants to flush the database"); + calendarDatabase.flush(); + + } else if (clientRequest.actionIs(ClientRequest.SHUTDOWN_SERVER)) { + Main.infoMessage("Server: Client wants the server to shut down"); + calendarDatabase.flush(); + socket.close(); + + if (Config.getBooleanValue("client_run")) { + Main.infoMessage("Server: Shutting down the server thread"); + socket.close(); + serverSocket.close(); + break; + } else { + Main.exit(0); + } + } + + socket.close(); + } + + } catch (ClassNotFoundException e) { + Main.infoMessage("Error: Server error during serialization: " + e.getMessage()); + + } catch (IOException e) { + Main.infoMessage("Error: Server error during serialization: " + e.getMessage()); + } + } +} diff --git a/shared/CalendarCategory.java b/shared/CalendarCategory.java new file mode 100644 index 0000000..7f4f346 --- /dev/null +++ b/shared/CalendarCategory.java @@ -0,0 +1,223 @@ +/** + * + */ +package shared; + +import java.util.Enumeration; +import java.util.Vector; +import java.util.regex.*; +import java.io.*; + +import shared.remotecall.*; + + +/** + * This class specifies a category of the calendar events. Its wrapping a vector of references + * of all events of this category. + * @author buetow + * + */ +public class CalendarCategory { + private Vector vecEvents; + private String sCategoryName; + private boolean bHasChanged = false; + private File categoryFile; + + /** + * Creates a new calendar category object and sets the categorie's name to the filename of the category. + * @param categoryFile The file object which contains the unparsed events for this specific category. It will be unset after parsing. + */ + public CalendarCategory(File categoryFile) { + this.categoryFile = categoryFile; + this.sCategoryName = categoryFile.getName(); + + // sCategoryName is now "calendar.Name", remove now the leading 'calendar.' + sCategoryName = sCategoryName.substring(sCategoryName.indexOf('.') + 1); + } + + /** + * Creates a new calendar category object and sets the categorie's File to the name of the category. + * @param sCategoryName Specifies the categorie's name. + */ + public CalendarCategory(String sCategoryName) { + this.sCategoryName = sCategoryName; + } + + /** + * This method sets the categorie's initial events. + * @param vecEvents Specifies the categorie's events. + */ + public void setEvents(Vector vecEvents) { + this.vecEvents = vecEvents; + } + + /** + * This method adds an event to the category. + * @param event Specifies the calendar event to add to this category. + */ + public void addEvent(CalendarEvent event) { + if (vecEvents == null) + vecEvents = new Vector(); + + vecEvents.add(event); + } + + /** + * This method returns the calendar events file object. + * @return Returns the categorie's file object. + */ + public File getFile() { + return categoryFile; + } + + /** + * This method Sets the categories file handle to null. This is done if all the data has been read from + * the file database. + */ + public void unsetFile() { + categoryFile = null; + } + + /** + * This method returns the categorie's name. + * @return Returns the categorie's name. + */ + public String getName() { + return sCategoryName; + } + + /** + * This method sets the categorie's name. + */ + public void setName(String sCategoryName) { + if (this.sCategoryName.equals(sCategoryName)) + return; + + deleteDatabaseFile(); + this.sCategoryName = sCategoryName; + categoryFile = new File(Config.getStringValue("server_database_dir")+"/calendar."+sCategoryName); + setHasChanged(true); + } + + /** + * This method deletes the database file of this event. + */ + public void deleteDatabaseFile() { + if (categoryFile == null) + categoryFile = new File(Config.getStringValue("server_database_dir")+"/calendar."+getName()); + + Main.infoMessage("Removing " + categoryFile.getPath()); + categoryFile.delete(); + } + + /** + * This method returns the categorie's events. + * @return Returns a Vector of all CalendarEvent objects. + */ + public Vector getEvents() { + return vecEvents; + } + + /** + * This method looks for all calendar events of this category which matches a given client's request. + * @param clientRequest Specifies the client request sent by the calendar client. + * @return Returns a Vector of all matching CalendarEvent objects. + */ + public Vector getMatchingEvents(ClientRequest clientRequest) { + Vector vecMatching = new Vector(); + int iNumEventsToRequest = clientRequest.getNumEventsToRequest(); + + Enumeration enumEvents = vecEvents.elements(); + while (enumEvents.hasMoreElements()) { + CalendarEvent event = (CalendarEvent) enumEvents.nextElement(); + if (clientRequest.match(event)) + vecMatching.add(event); + + if (iNumEventsToRequest > -1 && iNumEventsToRequest == vecMatching.size()) + break; + } + + return vecMatching; + } + + /** + * This method checks the current category's name against a regular expression pattern. + * @param pattern Specifies the pattern to be used. + * @return Returns true if the event matches, else false will be returned. + */ + public boolean matchesName(Pattern pattern) { + if (pattern == null) + return false; + + return pattern.matcher(getName()).find(); + } + + /** + * This method removes a given event from its event vector. + * @param event Specifies the calendar event object to be removed from this category + */ + public void removeEvent(CalendarEvent event) { + getEvents().removeElement(event); + } + + /** + * This method lets you check if the calendar category has been modified/changed by a + * calendar client request. This is needed by the CalendarDatabase.flush method, to write all + * the changes back to the database files. + * @return Returns true if the category has changed, else it will return false. + */ + public boolean hasChanged() { + return bHasChanged; + } + + /** + * This method merges two categories. + * @param calendarCategory Specifies the category to merge with. + */ + public void merge(CalendarCategory calendarCategory) { + Enumeration enumEvents = calendarCategory.getEvents().elements(); + while (enumEvents.hasMoreElements()) + vecEvents.add(enumEvents.nextElement()); + + System.out.println(vecEvents); + } + + /** + * This method specifies if the calendar category has been modified/changed or not. + * @param bHasChanged Specifies if the category has been modified/changed or not. + */ + public void setHasChanged(boolean bHasChanged) { + this.bHasChanged = bHasChanged; + } + + /** + * This method flushes the calendar category to the database at the filesystem. + */ + public void flush() { + Main.infoMessage("Flushing category " + getName() + " to database!"); + + if (vecEvents.size() == 0) { + deleteDatabaseFile(); + return; + } + + try { + FileWriter fileWriter = new FileWriter( + Config.getStringValue("server_database_dir") + "/calendar." + getName()); + BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); + + Enumeration enumEvent = vecEvents.elements(); + while (enumEvent.hasMoreElements()) { + CalendarEvent event = (CalendarEvent) enumEvent.nextElement(); + event.flush(bufferedWriter); + } + + bufferedWriter.close(); + + } catch (IOException e) { + Main.infoMessage("Error: Database flush error: " + e.getMessage()); + } + + setHasChanged(false); + } +} diff --git a/shared/CalendarEvent.java b/shared/CalendarEvent.java new file mode 100644 index 0000000..176c42c --- /dev/null +++ b/shared/CalendarEvent.java @@ -0,0 +1,339 @@ +/** + * + */ +package shared; + +import java.util.*; +import java.util.regex.*; +import java.io.*; + +/** + * This class specifies calendar events. Calendar event objects are the most used objects of the + * whole netcalendar suite. + * @author buetow + * + */ +public class CalendarEvent implements Serializable { + private static final long serialVersionUID = 1L; + private MyDate date; + private CalendarCategory category; + private String sCategoryName; + private String sDescription; + private String sPlace; + private boolean bYearly; + private int iEventID; + + static private int iEventIDCount = 0; + + /** + * Simple constructor, creates an event object and increments iEventIDCount by one. + * @param category Specifies the event's category. + */ + public CalendarEvent(CalendarCategory category) { + setCategory(category); + setEventID(iEventIDCount++); + setYearly(false); + } + + /** + * Simple constructor, creates an event object and increments iEventIDCount by one. + * @param sCategoryName Specifies the event's category name. + */ + public CalendarEvent(String sCategoryName) { + setCategoryName(sCategoryName.trim()); + setEventID(iEventIDCount++); + setYearly(false); + } + + /** + * This method sets the event's date. + * @param date Specifies the event's date. + */ + public void setDate(Date date) { + if (date instanceof MyDate) + this.date = (MyDate) date; + else + this.date = new MyDate(date); + } + + /** + * This method sets the event's category. + * @param category Specifies the event's category. + */ + public void setCategory(CalendarCategory category) { + this.category = category; + setCategoryName(category.getName()); + } + + /** + * This event returns the event's calendar category. + * @return Returns the event's calenda category. + */ + public CalendarCategory getCategory() { + return category; + } + + /** + * This methos sets thhe event's category name. + * @param sCategoryName Specifies the event's category name. + */ + public void setCategoryName(String sCategoryName) { + this.sCategoryName = sCategoryName.trim(); + } + + /** + * This method sets the event's descriptions tring. + * @param sDescription Specifies the event's description string. + */ + public void setDescription(String sDescription) { + this.sDescription = sDescription.trim(); + } + + /** + * This method sets the event's place string. + * @param sPlace Specifies the event's place string. + */ + public void setPlace(String sPlace) { + this.sPlace = sPlace.trim(); + } + + /** + * This method sets the event's ID number. + * @param iEventID specifies the event's ID number. + */ + public void setEventID(int iEventID) { + this.iEventID = iEventID; + } + + /** + * This method specifies if this event occurs yearly or not. + * @param bYearly Specifies if this event occury yearly or not. + */ + public void setYearly(boolean bYearly) { + this.bYearly = bYearly; + } + + /** + * This method returns the event's category name. + * @return Returns the event's category name. + */ + public String getCategoryName() { + return sCategoryName; + } + + /** + * This method returns the event's description string. + * @return Returns the event's description string. + */ + public String getDescription() { + return sDescription; + } + + /** + * This method returns the event's place string. + * @return Returns the event's place string. + */ + public String getPlace() { + return sPlace; + } + + /** + * This method returns the event's ID. + * @return Returns the event's ID. + */ + public int getID() { + return iEventID; + } + + /** + * This method returns the event's date object. + * @return Returns the event's date object. + */ + public MyDate getDate() { + return date; + } + + /** + * This method returns the event's ID number. + * @return Returns the event's ID number. + */ + public int getEventID() { + return iEventID; + } + + /** + * This method checks if this event occurs yearly or not. + * @return Returns true if the event occurs yearly, else it returns false. + */ + public boolean isYearly() { + return bYearly; + } + + /** + * Checks if the current event matches all available data of the event agains + * a given regular expression pattern. + * @param pattern Specifies the pattern to match against. + * @return Returns true if one element of the event matches. + */ + public boolean matches(Pattern pattern) { + if (pattern == null) + return false; + + else if (matchesDescription(pattern)) + return true; + + else if (matchesPlace(pattern)) + return true; + + else if (matchesCategoryName(pattern)) + return true; + + return matchesDateString(pattern); + } + + /** + * Checks if the current event's name matches agains a regular expression pattern. + * @param pattern Specifies the pattern to be matched against. + * @return Returns true if the event matches, else false will be returned. If the pattern is null, true will be returned. + */ + public boolean matchesCategoryName(Pattern pattern) { + if (pattern == null) + return true; + + return pattern.matcher(getCategoryName()).find(); + } + + /** + * Checks if the current event's description string matches agains a regular expression pattern. + * @param pattern Specifies the pattern to match against. + * @return Returns true if the event matches, else false will be returned. If the pattern is null, true will be returned. + */ + public boolean matchesDescription(Pattern pattern) { + if (pattern == null) + return true; + + return pattern.matcher(getDescription()).find(); + } + + /** + * Checks if the current event's place string matches agains a regular expression pattern. + * @param pattern Specifies the pattern to match against. + * @return Returns true if the event matches, else false will be returned. If the pattern is null, true will be returned. + */ + public boolean matchesPlace(Pattern pattern) { + if (pattern == null) + return true; + + return pattern.matcher(getPlace()).find(); + } + + /** + * Checks if the current event's category name matches agains a regular expression pattern + * @param pattern Specifies the pattern to match against. + * @return Returns true if the event matches, else false will be returned. If the pattern is null, true will be returned. + */ + public boolean matchesCategory(Pattern pattern) { + if (pattern == null) + return true; + + return pattern.matcher(getCategoryName()).find(); + } + + /** + * Checks if the current event's date string matches agains a regular expression pattern + * @param pattern Specifies the pattern to match against. + * @return Returns true if the event matches, else false will be returned. If the pattern is null, true will be returned. + */ + public boolean matchesDateString(Pattern pattern) { + if (pattern == null) + return true; + + return pattern.matcher(getDate().toString()).find(); + } + + /** + * Needed for ojbect serialization (sending part)- + * @param objectOutputStream Specifies the output stream to use. + * @throws IOException + */ + private void writeObject(ObjectOutputStream objectOutputStream) + throws IOException { + objectOutputStream.writeInt(iEventID); + objectOutputStream.writeBoolean(isYearly()); + objectOutputStream.writeObject(getDate()); + objectOutputStream.writeObject(getCategoryName()); + objectOutputStream.writeObject(getDescription()); + objectOutputStream.writeObject(getPlace()); + } + + /** + * Needed for object serialization (receiving part). + * @param objectInputStream Specifies the input stream to use. + * @throws IOException + * @throws ClassNotFoundException + */ + private void readObject(ObjectInputStream objectInputStream) + throws IOException, ClassNotFoundException { + setEventID(objectInputStream.readInt()); + setYearly(objectInputStream.readBoolean()); + setDate((Date) objectInputStream.readObject()); + setCategoryName((String) objectInputStream.readObject()); + setDescription((String) objectInputStream.readObject()); + setPlace((String) objectInputStream.readObject()); + + if (getEventID() < 0 ) + setEventID(iEventIDCount++); + } + + /** + * Removes the calendar event from its current category and sets the + * category reference to null. + */ + public void removeFromCurrentCategory() { + CalendarCategory category = getCategory(); + category.removeEvent(this); + } + + /** + * This method flushes the calendar event to the database at the filesystem. + * @param bufferedWriter Specifies the buffered writer to write to. + */ + protected void flush(BufferedWriter bufferedWriter) throws IOException { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(getDate()); + int iYear = calendar.get(Calendar.YEAR); + // if (iYear < 11) iYear += 2000; + int iMonth = calendar.get(Calendar.MONTH) + 1; + int iDays = calendar.get(Calendar.DAY_OF_MONTH); + int iHours= calendar.get(Calendar.HOUR); + int iMinutes = calendar.get(Calendar.MINUTE); + + String sPlace = getPlace(); + if (!sPlace.equals("")) + sPlace = ";;" + sPlace; + + String sYearly = isYearly() ? "yearly" : MyDate.addZerosToFront(iYear, 4); + String sEventLine = + MyDate.addZerosToFront(iMonth, 2) + "/" + + MyDate.addZerosToFront(iDays, 2) + "\t" + + sYearly + "-" + + MyDate.addZerosToFront(iHours, 2) + ":" + + MyDate.addZerosToFront(iMinutes, 2) + " " + + getDescription() + + sPlace + "\n"; + + bufferedWriter.write(sEventLine); + } + + /** + * This method is needed for a text representation of the object. + * @return Returns object represented as a String. + */ + public String toString() { + return "#" + getEventID() + " " + getDate() + "\n" + + "Yearly : " + isYearly() + "\n" + + "Category : " + getCategoryName() + "\n" + + "Description: " + getDescription() + "\n" + + "Place : " + getPlace() + "\n"; + } +} diff --git a/shared/Config.java b/shared/Config.java new file mode 100644 index 0000000..5d79c6f --- /dev/null +++ b/shared/Config.java @@ -0,0 +1,236 @@ +package shared; + +import java.util.*; +import java.net.*; +import java.io.*; + +/** + * This class makes all the configuration options available to all the other classes and objects + * of this program. Its reading and writing back the values from and to the config.txt file. + * @author buetow + * + */ +public final class Config { + public static final String VERSION = "NetCalendar 1.0"; + private static final String CONFIG_FILE = "config.txt"; + private static HashMap mapConfigVals; + + /** + * Initializes all the config values. + * @param args The start parameters. + */ + public static void initialize(String[] args) { + if (args.length > 0) { + if (args[0].equals("--help")) { + System.out.println(Config.VERSION + " help"); + System.out.println("(c) 2006, 2009 by Dipl.-Inform. (FH) Paul C. Buetow [netcalendar@dev.buetow.org]"); + System.out.println("This is free software, see the LICENSE.txt for copying conditions. There is NO"); + System.out.println("warranty; not even for MERCHANTABILITY of FITNESS FOR A PARTICULAR PURPOSE."); + System.out.println(); + System.out.println("Possible start parameters are:"); + System.out.println("\t--help Shows this help and exists"); + System.out.println("\t--client-only Runs the NetCalendar client only"); + System.out.println("\t--server-address=host Specifies the server host to connect to"); + System.out.println("\t--server-only Runs the NetCalendar server only"); + System.out.println("\t--client-and-server Runs the NetCalendar server and client"); + System.out.println("\t within the same process!"); + System.out.println(); + System.exit(0); + } + } + + mapConfigVals = new HashMap(); + readConfig(CONFIG_FILE); + + for (int i = 0; i < args.length; ++i) { + if (args[i].equals("--server-only")) { + mapConfigVals.put("server_run", "true"); + mapConfigVals.put("client_run", "false"); + + } else if(args[i].equals("--client-only")) { + mapConfigVals.put("server_run", "false"); + mapConfigVals.put("client_run", "true"); + + } else if(args[i].equals("--client-and-server")) { + mapConfigVals.put("server_run", "true"); + mapConfigVals.put("client_run", "true"); + mapConfigVals.put("server_address", "localhost"); + + } else if(args[i].startsWith("--server-address=")) { + mapConfigVals.put("server_address", args[i].substring(17)); + } + } + + if (args.length > 0) + writeConfigToFile(); + } + + /** + * This methods reads the options from the calendar config file 'config.txt'. + * @param sConfigFile Specifies the relative or absolute path to the config file. + */ + public static void readConfig(String sConfigFile) { + Main.infoMessage("Config: Using config file " + sConfigFile); + File file = new File(sConfigFile); + + if (!file.isFile()) { + Main.infoMessage("Config: " + sConfigFile + " is not a file!"); + System.exit(1); + } + + try { + BufferedReader in = new BufferedReader(new FileReader(file)); + String sLine; + + while ((sLine = in.readLine()) != null) { + int iSeperator = sLine.indexOf('='); + + if (iSeperator > -1) { + int iEnd = sLine.indexOf(';'); + + if (iEnd > -1) { + String sKey = sLine.substring(0, iSeperator).trim(); + String sVal = sLine.substring(iSeperator+1, iEnd).trim(); + mapConfigVals.put(sKey, sVal); + } + } + } + + } catch (Exception e) { + Main.infoMessage("Config: " + e.getMessage()); + System.exit(1); + } + } + + /** + * This method returns the inet address of the calendar server. + * @return Returns the calendar server's address . + */ + public static InetAddress getServerAddress() { + InetAddress serverAddress = null; + + try { + serverAddress = InetAddress.getByName(Config.getStringValue("server_address")); + } catch(Exception e) { + Main.infoMessage("Server address error: " + e.getMessage()); + } + + return serverAddress; + } + + /** + * This method returns a specific string config value. + * @param sKey Specifies the key of the config value to return. + * @return Returns the requested config value. + */ + public static String getStringValue(String sKey) { + return getStringValue(sKey, true); + } + + /** + * This method returns a specific string config value. + * @param sKey Specifies the key of the config value to return. + * @param bLogMessages Specifies if this action should be logged or not. + * @return Returns the requested config value. + */ + public static String getStringValue(String sKey, boolean bLogMessage) { + String sRet = (String) mapConfigVals.get(sKey); + + if (sRet != null) + sRet = sRet.trim(); + + return sRet; + } + + /** + * This method returns a specific integer config value. + * @param sKey Specifies the key of the config value to return. + * @return Returns the requested config value. + */ + public static int getIntValue(String sKey) { + String sVal = (String) mapConfigVals.get(sKey); + + if (sVal != null) + sVal = sVal.trim(); + + return Integer.parseInt(sVal); + } + + /** + * This method returns a specific boolean config value. + * @param sKey Specifies the key of the config value to return. + * @return Returns the requested config value. + */ + public static boolean getBooleanValue(String sKey) { + String sVal = (String) mapConfigVals.get(sKey); + + if (sVal != null) + sVal = sVal.trim(); + + boolean bRet = false; + + if (sVal != null) + bRet = sVal.equals("true"); + + return bRet; + } + + /** + * This method returns a set of keys of the config hash map. + * @return Returns a Set object containing all keys of the Config's hash map. + */ + public static Set getKeySet() { + return mapConfigVals.keySet(); + } + + /** + * This method changes or adds a specific config value. + * @param sKey Specifies the config key to set or update. + * @param sVal Specifies the value of the key to set or update. + */ + public static void setValue(String sKey, String sVal) { + mapConfigVals.put(sKey, sVal); + } + + /** + * This method returns a sorted String array of all available config keys. + * @return Returns a sorted String array of all available config keys. + */ + public static String [] getSortedKeyArray() { + Set keySet = getKeySet(); + Object [] keys = keySet.toArray(); + int iNumPairs = keys.length; + String [] sKeys = new String[iNumPairs]; + + for (int i = 0; i < iNumPairs; ++i) + sKeys[i] = (String) keys[i]; + + Arrays.sort(sKeys); + + return sKeys; + } + + /** + * This method writes the current configuration to the config file "config.txt". + */ + public static void writeConfigToFile() { + String [] sKeys = getSortedKeyArray(); + int iNumKeys = sKeys.length; + + try { + FileWriter fileWriter = new FileWriter(CONFIG_FILE); + BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); + + for (int i = 0; i < iNumKeys; ++i) { + String sKey = sKeys[i]; + String sVal = getStringValue(sKey); + bufferedWriter.write(sKey + "=" + sVal + ";\n"); + } + + bufferedWriter.close(); + + } catch(IOException e) { + Main.infoMessage("Error: " + e.toString()); + } + } +} diff --git a/shared/DoCallback.java b/shared/DoCallback.java new file mode 100644 index 0000000..fd35642 --- /dev/null +++ b/shared/DoCallback.java @@ -0,0 +1,10 @@ +package shared; + +/** + * This interface specifies a callback routine. + * @author buetow + * + */ +public interface DoCallback { + public void callback(Object o); +} diff --git a/shared/Main.java b/shared/Main.java new file mode 100644 index 0000000..24edc0d --- /dev/null +++ b/shared/Main.java @@ -0,0 +1,125 @@ +package shared; + +import java.io.*; + +import javax.swing.JFrame; + +import server.*; + +import client.*; + +/** + * This class contains the static main method to start the program from. + * This class is also responsible for handling info ans status messages and + * the logging option of those messages. + * @author buetow + * + */ +public final class Main { + private static NetCalendarClient netCalendarClient = null; + private static BufferedWriter bufferedLogfileWriter = null; + + /** + * This method is the start point of the whole program. Its initializing the static Config object + * and starts a calendar server and/or a calendar client thread depending on the "server_run" and + * "client_run" configuration options. + * @param args Specifies the program arguments (not used yet by the program) + */ + public static void main(String[] args) { + Config.initialize(args); + + try { + FileWriter fileWriter = new FileWriter(Config.getStringValue("logfile")); + bufferedLogfileWriter = new BufferedWriter(fileWriter); + + } catch (IOException e) { + infoMessage("Error: Could not open logfile: " + e.getMessage()); + } + + + if (Config.getBooleanValue("server_run")) { + new NetCalendarServer( + Config.getIntValue("server_port"), + Config.getStringValue("server_database_dir")); + } + + if (Config.getBooleanValue("client_run")) { + new Thread(new SplashScreen()).start(); + //Make sure we have nice window decorations. + JFrame.setDefaultLookAndFeelDecorated(true); + netCalendarClient = new NetCalendarClient(); + } + } + + /** + * All info messages of the calendar client and the calendar server go through this method. + * They are not using System.out.* directly. + * @param sMessage Specifies the program info message. + */ + public static void infoMessage(String sMessage) { + // Later: Add logging to a logfile! + System.out.println(sMessage); + logMessage(sMessage); + } + + /** + * This method is for various messages. All messages will show up in the status bar of the client's main window. + * If there is no main window, the infoMessage method will be used instead. + * @param sMessage Specifies the message to be displayed in the status bar. + */ + public static void statusMessage(String sMessage) { + if (netCalendarClient != null) + netCalendarClient.statusMessage(sMessage); + else + infoMessage(sMessage); + } + + /** + * This method writes a specific message string into a logfile which is specified in the config.txt. + * @param sMessage Specified the message string to write into the logfile. + */ + private static void logMessage(String sMessage) { + if (bufferedLogfileWriter != null) { + try { + bufferedLogfileWriter.write(sMessage + "\n"); + // bufferedLogfileWriter.flush(); + + } catch(IOException e) { + Main.infoMessage("Error: Could not write to logfile: " + e.toString()); + } + } + } + + /** + * This method is called thenever the server or the client process wants to exit. + * @param iCode Specifies the exit code to use for the System.exit call. + */ + public static void exit(int iCode) { + infoMessage("Shutting down the current process"); + + try { + bufferedLogfileWriter.close(); + } catch(IOException e) { + System.err.println("Error: Could not close logfile: " + e.toString()); + } + + System.exit(iCode); + } + + + /** + * This method executes an external program. + * @param sCommand Specifies the command string to execute. + */ + public static void execExternalCommand(String sCommand) { + if (sCommand.equals("none") || sCommand.equals("")) + return; + + try { + Runtime.getRuntime().exec(sCommand); + + } catch (IOException e) { + Main.infoMessage("Error while executing external command: " + e.getMessage()); + } + } +} diff --git a/shared/MyDate.java b/shared/MyDate.java new file mode 100644 index 0000000..664ce91 --- /dev/null +++ b/shared/MyDate.java @@ -0,0 +1,54 @@ +package shared; + +import java.util.*; + +/** + * This class extends the standard Date class and customizes the toString method. + * This class also contains some helper methods to make the life easier. + * @author buetow + * + */ +public class MyDate extends Date { + private final static long serialVersionUID = 1L; + private final static String [] DAYS = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; + + /** + * Copy constructor. + * @param data Specifies the date objekt to copy the time from. + */ + public MyDate(Date date) { + super(date.getTime()); + } + + /** + * @see java.lang.Object#toString() + */ + public String toString() { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(this); + + String sYear = addZerosToFront(calendar.get(Calendar.YEAR), 4); + String sMonth = addZerosToFront(calendar.get(Calendar.MONTH) + 1, 2); + String sDays = addZerosToFront(calendar.get(Calendar.DAY_OF_MONTH), 2); + String sHours= addZerosToFront(calendar.get(Calendar.HOUR), 2); + String sMinutes = addZerosToFront(calendar.get(Calendar.MINUTE), 2); + String sDay = DAYS[calendar.get(Calendar.DAY_OF_WEEK)-1]; + + return sDays + "." + sMonth + "." + sYear + " " + sHours + ":" + sMinutes + " " + sDay; + } + + /** + * This method adds zeros in front of a number and returns it as a string. + * @param iValue Specifies the number to add zeros to. + * @param iWantedLength Specifies the wanted max length of the string. + * @return Returns the number represented as a string with additional zeros on front. + */ + public static String addZerosToFront(int iValue, int iWantedLength) { + String sValue = iValue + ""; + + while (sValue.length() < iWantedLength) + sValue = "0" + sValue; + + return sValue; + } +} diff --git a/shared/MyVector.java b/shared/MyVector.java new file mode 100644 index 0000000..9d9d596 --- /dev/null +++ b/shared/MyVector.java @@ -0,0 +1,23 @@ +package shared; + +import java.util.Enumeration; +import java.util.Vector; + +/** + * This class extends the standard Vector class and defined additional help methods. + * @author buetow + * + */ +public class MyVector extends Vector { + private static final long serialVersionUID = 1L; + + /** + * This method appends a vector at the end. + * @param vecAppend Specifies the vector to be appended. + */ + public void appendVector(Vector vecAppend) { + Enumeration enumAppend = vecAppend.elements(); + while (enumAppend.hasMoreElements()) + this.add(enumAppend.nextElement()); + } +} diff --git a/shared/remotecall/ClientRequest.java b/shared/remotecall/ClientRequest.java new file mode 100644 index 0000000..ed31ed3 --- /dev/null +++ b/shared/remotecall/ClientRequest.java @@ -0,0 +1,369 @@ +package shared.remotecall; + +import java.util.*; +import java.io.*; +import java.util.regex.*; + +import shared.*; + +/** + * An object of this class is sent from the calendar client to the calendar server each time + * a request is made. This class encapsulates all the needed information so that the server can + * response with a serialized server response object. + * @author buetow + * + */ +public final class ClientRequest extends RemoteCall implements Serializable { + private static final long serialVersionUID = 6L; + private static final Pattern emptyPattern = Pattern.compile("[^\\s]"); + + public static final int REQUEST_EVENTS = 0; + public static final int REQUEST_ALL_EVENTS = 1; + public static final int MODIFY_EVENT = 2; + public static final int DELETE_EVENT = 3; + public static final int ADD_EVENT = 4; + public static final int RELOAD_DATABASE = 5; + public static final int FLUSH_DATABASE = 6; + public static final int SHUTDOWN_SERVER = 7; + public static final int RENAME_CATEGORY = 8; + public static final int DELETE_CATEGORY = 9; + + private int iAction = 0; + private int iNumEventsToRequest; + + private boolean bMainRegexp; + private boolean bCaseInsensitive; + + private Pattern patAll = null; + private Pattern patCategory = null; + private Pattern patDescription = null; + private Pattern patPlace = null; + private Pattern patDate = null; + private Date dateRangeFrom = null; + private Date dateRangeTo = null; + private CalendarEvent event = null; + private String sPassphrase; + private String sString = null; + + /** + * Simple constructor, creates a client request object requesting events up + * from the current date. + */ + public ClientRequest() { + dateRangeFrom = new Date(); + initialize(REQUEST_EVENTS); + } + + /** + * Simple constructor, creates a client request object requesting events up + * from the current date. + * @param iAction Specifies the request type of this request. + */ + public ClientRequest(int iAction) { + dateRangeFrom = new Date(); + initialize(iAction); + } + + /** + * This method initializes some common stuff. Called by each constructor. + * @param iAction Specifies the request type of this request. + */ + private void initialize(int iAction) { + this.iAction = iAction; + this.sPassphrase = Config.getStringValue("passphrase", false); + this.bCaseInsensitive = Config.getBooleanValue("regexp_case_insensitive"); + this.iNumEventsToRequest = Config.getIntValue("client_max_events"); + } + + /** + * This method is needed by the clanedar server to get the type of action requested. + * @param iAction Specifies the action to test against. + * @return Returns true if the specified action ID matches with the action ID of this request object. + */ + public boolean actionIs(int iAction) { + return this.iAction == iAction; + } + + /** + * This method is needed by the calendar server to get the type of action requested. + * @return Returns true if this object requests new events from the server. + */ + public boolean requestsNewEvents() { + return this.iAction < ClientRequest.MODIFY_EVENT; + } + + /** + * This method sets the date range to request. + * @param dateRangeFrom Specifies the beginning date. + * @param dateRangeTo Specifies the ending date. + */ + public void setDateRange(Date dateRangeFrom, Date dateRangeTo) { + this.dateRangeFrom = dateRangeFrom; + this.dateRangeTo = dateRangeTo; + } + + /** + * This method sets a calendar event object to be transfered to the calendar server because the event has been modified. + * @param event Specifies an event to be transfered to the calendar server. + */ + public void setEvent(CalendarEvent event) { + this.event = event; + if (actionIs(ADD_EVENT)) + event.setEventID(-1); + } + + /** + * This method returns the event object. + * @return Returns the calendar event which is stored inside this client request. + */ + public CalendarEvent getEvent() { + return event; + } + + /** + * With this method the client can define the maximum number of events to request. + * @param iNumEvents Specifies the maximum number of events to request. + */ + public void setNumEventsToRequest(int iNumEvents) { + this.iNumEventsToRequest = iNumEvents; + } + + /** + * This method returns the maximum number of events the client wants to request. + * @return Returns the maximum number of events the client wants to request. + */ + public int getNumEventsToRequest() { + return iNumEventsToRequest; + } + + /** + * This method sets if the client contains a regexp from the main session window. + * @param bMainRegexp Set to true if the user used the main regexp field of the main GUI window. + */ + public void setMainRegexp(boolean bMainRegexp) { + this.bMainRegexp = bMainRegexp; + } + + /** + * This method compiles a specific pattern object to match with on the server part after serialization. + * @param sRegexp Compiles a Pattern object with sRegexp as the regular expression. + */ + public void setRegexpAll(String sRegexp) { + if (isEmptyPattern(sRegexp)) + return; + + if (bCaseInsensitive) + patAll = Pattern.compile(sRegexp, Pattern.CASE_INSENSITIVE); + else + patAll = Pattern.compile(sRegexp); + } + + /** + * This method compiles a specific pattern object to match with on the server part after serialization. + * @param sRegexp Compiles a Pattern object with sRegexp as the regular expression. + */ + public void setRegexpCategory(String sRegexp) { + if (isEmptyPattern(sRegexp)) + return; + + if (bCaseInsensitive) + patCategory = Pattern.compile(sRegexp, Pattern.CASE_INSENSITIVE); + else + patCategory = Pattern.compile(sRegexp); + } + + /** + * This method compiles a specific pattern object to match with on the server part after serialization. + * @param sRegexp Compiles a Pattern object with sRegexp as the regular expression. + */ + public void setRegexpDescription(String sRegexp) { + if (isEmptyPattern(sRegexp)) + return; + + if (bCaseInsensitive) + patDescription = Pattern.compile(sRegexp, Pattern.CASE_INSENSITIVE); + else + patDescription = Pattern.compile(sRegexp); + } + + /** + * This method sets a string to be transfered to the netcalendar server. + * @param sString specifies the string to be transfered. + */ + public void setString(String sString) { + this.sString = sString; + } + + /** + * This method returns a string transfered by the netcalendar client. If no string has been transfered, + * null will be returned. + * @return Returns a string transfered by the netcalendar client. + */ + public String getString() { + return sString; + } + + /** + * This method compiles a specific pattern object to match with on the server part after serialization. + * @param sRegexp Compiles a Pattern object with sRegexp as the regular expression. + */ + public void setRegexpPlace(String sRegexp) { + if (isEmptyPattern(sRegexp)) + return; + + if (bCaseInsensitive) + patPlace = Pattern.compile(sRegexp, Pattern.CASE_INSENSITIVE); + else + patPlace = Pattern.compile(sRegexp); + } + + /** + * This method compiles a specific pattern object to match with on the server part after serialization. + * @param sRegexp Compiles a Pattern object with sRegexp as the regular expression. + */ + public void setRegexpDate(String sRegexp) { + if (isEmptyPattern(sRegexp)) + return; + + if (bCaseInsensitive) + patDate = Pattern.compile(sRegexp, Pattern.CASE_INSENSITIVE); + else + patDate = Pattern.compile(sRegexp); + } + + /** + * Checks if a specific calendar event matches this client request. + * @param calendarEvent Specifies the event to match against. + * @return Returns true if the given event matched. Else, false will be returned. + */ + public boolean match(CalendarEvent calendarEvent) { + // If we want to get all events! + if (actionIs(REQUEST_ALL_EVENTS)) + return true; + + // If we use the regex field of the main GUI + if (bMainRegexp) + return calendarEvent.matches(patAll); + + // If we use advanced searching: + if (dateRangeFrom != null) + if (dateRangeFrom.getTime() > calendarEvent.getDate().getTime()) + return false; + + if (dateRangeTo != null) + if (dateRangeTo.getTime() < calendarEvent.getDate().getTime()) + return false; + + if (calendarEvent.matches(patAll) || + (calendarEvent.matchesDescription(patDescription) + && calendarEvent.matchesCategory(patCategory) + && calendarEvent.matchesPlace(patPlace) + && calendarEvent.matchesDateString(patDate))) + return true; + + return false; + } + + /** + * Needed for ojbect serialization (sending part). + * @param objectOutputStream Specifies the output stream to use. + * @throws IOException + */ + private void writeObject(ObjectOutputStream objectOutputStream) + throws IOException { + objectOutputStream.writeInt(iAction); + objectOutputStream.writeInt(iNumEventsToRequest); + objectOutputStream.writeObject(sPassphrase); + objectOutputStream.writeBoolean(bMainRegexp); + objectOutputStream.writeBoolean(bCaseInsensitive); + + super.writeObjectIfDefined(objectOutputStream, sString); + super.writeObjectIfDefined(objectOutputStream, patAll); + super.writeObjectIfDefined(objectOutputStream, patCategory); + super.writeObjectIfDefined(objectOutputStream, patDescription); + super.writeObjectIfDefined(objectOutputStream, patPlace); + super.writeObjectIfDefined(objectOutputStream, patDate); + super.writeObjectIfDefined(objectOutputStream, dateRangeFrom); + super.writeObjectIfDefined(objectOutputStream, dateRangeTo); + super.writeObjectIfDefined(objectOutputStream, event); + } + + /** + * Needed for object serialization (recieving part). + * @param objectInputStream Specifies the input stream to use. + * @throws IOException + * @throws ClassNotFoundException + */ + private void readObject(ObjectInputStream objectInputStream) + throws IOException, ClassNotFoundException { + + iAction = objectInputStream.readInt(); + iNumEventsToRequest = objectInputStream.readInt(); + sPassphrase = (String) objectInputStream.readObject(); + setMainRegexp(objectInputStream.readBoolean()); + bCaseInsensitive = objectInputStream.readBoolean(); + + if (objectInputStream.readBoolean()) + sString = (String) objectInputStream.readObject(); + + if (objectInputStream.readBoolean()) + patAll = (Pattern) objectInputStream.readObject(); + + if (objectInputStream.readBoolean()) + patCategory = (Pattern) objectInputStream.readObject(); + + if (objectInputStream.readBoolean()) + patDescription = (Pattern) objectInputStream.readObject(); + + if (objectInputStream.readBoolean()) + patPlace = (Pattern) objectInputStream.readObject(); + + if (objectInputStream.readBoolean()) + patDate = (Pattern) objectInputStream.readObject(); + + if (objectInputStream.readBoolean()) + dateRangeFrom = (Date) objectInputStream.readObject(); + + if (objectInputStream.readBoolean()) + dateRangeTo = (Date) objectInputStream.readObject(); + + if (objectInputStream.readBoolean()) + event = (CalendarEvent) objectInputStream.readObject(); + } + + /** + * Checks if a given pattern string has other charactars than whitespaces inside or not. + * @param sRegexp Specifies the pattern string to check against. + * @return Returns true if the pattern string only contains whitespaces. Else, false will be returned. + */ + private boolean isEmptyPattern(String sRegexp) { + return !emptyPattern.matcher(sRegexp).find(); + } + + /** + * This method checks if the request's passphrase is correct or not. + * @param sPassphrase Specifies the server passphrase to chack against the request passphrase. + * @return Returns true if the passphrases equal. Else, false will be returned. + */ + public boolean checkPassphrase(String sPassphrase) { + return this.sPassphrase.equals(sPassphrase); + } + + /** + * This method returns a representation the object as a string. + * @return Returns the object represented as a string. + */ + public String toString() { + return + "Action : " + iAction + "\n" + + "NumEvents : " + iNumEventsToRequest + "\n" + + "MainRegexp : " + bMainRegexp + "\n" + + "patAll : " + patAll + "\n" + + "patCategory : " + patCategory + "\n" + + "patDescription: " + patDescription + "\n" + + "patDate : " + patDate + "\n" + + "dateRangeFrom : " + dateRangeFrom + "\n" + + "dateRangeTo : " + dateRangeTo + "\n" + + "modifiedEvent :\n" + event+ "\n"; + } +} diff --git a/shared/remotecall/RemoteCall.java b/shared/remotecall/RemoteCall.java new file mode 100644 index 0000000..5accf28 --- /dev/null +++ b/shared/remotecall/RemoteCall.java @@ -0,0 +1,29 @@ +package shared.remotecall; + +import java.io.*; + +/** + * This is the abstract base class of all other classes of the shared.remotecall package. + * Its defining some common methods. + * @author buetow + * + */ +public abstract class RemoteCall { + /** + * This is a help method for writeObject of the child classes, needed for ojbect serialization (sending part). + * It checks if object is defined. If yes, it will be written to the given object output stream with a leading + * flag with the value true. Otherwise only the false flag will be written to the object output stream. + * @param objectOutputStream Specifies the output stream. + * @throws IOException + */ + protected final void writeObjectIfDefined(ObjectOutputStream objectOutputStream, Object object) + throws IOException { + if (object == null) { + objectOutputStream.writeBoolean(false); + + } else { + objectOutputStream.writeBoolean(true); + objectOutputStream.writeObject(object); + } + } +} diff --git a/shared/remotecall/ServerResponse.java b/shared/remotecall/ServerResponse.java new file mode 100644 index 0000000..d2990bc --- /dev/null +++ b/shared/remotecall/ServerResponse.java @@ -0,0 +1,53 @@ +package shared.remotecall; + +import java.io.*; +import java.util.Vector; + +/** + * This class represents a server response. A server response will sent from the calendar + * server to the calendar client if the client has sent a client request. + * @author buetow + * + */ +public final class ServerResponse extends RemoteCall implements Serializable { + private static final long serialVersionUID = 1L; + private Vector vecEvents = null; + + /** + * Simple constructor, creates a server response which can be sent to the calendar client. + * @param vecEvents Specifies all calendar events to be sent to the calendar client. + */ + public ServerResponse(Vector vecEvents) { + this.vecEvents = vecEvents; + } + + /** + * Needed for ojbect serialization (sending part). + * @param objectOutputStream Specifies the output stream. + * @throws IOException + */ + private void writeObject(ObjectOutputStream objectOutputStream) + throws IOException { + super.writeObjectIfDefined(objectOutputStream, vecEvents); + } + + /** + * Needed for object serialization (recieving part). + * @param objectInputStream Specifies the input stream. + * @throws IOException + * @throws ClassNotFoundException + */ + private void readObject(ObjectInputStream objectInputStream) + throws IOException, ClassNotFoundException { + if (objectInputStream.readBoolean()) + vecEvents = (Vector) objectInputStream.readObject(); + } + + /** + * This method returns a vector of all requested calendar events. + * @return Returns a Vector of all requested CalendarEvent objects. + */ + public Vector getEvents() { + return vecEvents; + } +} -- cgit v1.2.3