JTelegraph is a small library for providing messaging notification features to Java applications. It can be used as a replacement for modal message boxes. It is an attempt to replace modal messages with a fancy new messaging system.
This library is licensed under the New BSD License. I want to call your attention to the fact that the New BSD License has been verified as a GPL-compatible free software license by the Free Software Foundation, and has been vetted as an open source license by the Open Source Initiative.
I must point out that this library makes use of the Simplicio iconset created by neurovit. This iconset is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0). Make sure your project complies with both licenses before using this library.
When I wrote this library, one of my first goals was to provide an easy yet powerful message notification libray. As a result, JTelegraph has some nice features, including:
- Easy setup and use, no complicated procedures. With only three lines of code, your application will be able to display message notifications!
- A small yet powerful library. The code itself is optmized, the payload refers to the image icons.
- Multiple messages notifications support. This is done through a message notification queue manager.
- Platform independent, runs everywhere. Thanks to Java, you'll be able to run this wherever there's a Java Virtual Machine.
- 100% pure Java library. No external system calls. Write once, run everywhere. Portability matters.
JTelegraph was designed to be used with existing Java applications with a little code replacement. Just three lines and the message notification system is up and running!
Unfortunately, there are some limitations in JTelegraph. If one of the following items is a relevant issue for you, I'll recommend you to not use this library, unless of course you want by your own risk. I hope to fix this list in the near future.
- I have not tested this library as thoroughly as I wanted. I'm almost sure there may be hidden bugs or glitches, so if you can provide me some feedback on that, it surely will help me a lot. Just make sure to include all necessary steps to recreate the bug/glitch.
I'd appreciate some help on this, thanks.
Telegraph telegraph = new Telegraph("Connection status", "The DB connection was established successfully", TelegraphType.NOTIFICATION_DONE, WindowPosition.BOTTOMLEFT, 4000); TelegraphQueue queue = new TelegraphQueue(); queue.add(telegraph);
Wait a minute, is that it?! Yeah, plain and simple. It's the good old K.I.S.S. design principle: "Keep it simple, stupid". Now let's take a look on the parameter of the
Telegraph class constructor method:
public Telegraph(String title, String message, TelegraphType type, WindowPosition position, int duration)
titleis the title of the message.
messageis the the message itself. Virtually there is no limit for this message length, as the window is supposed to automatically resize. Since this message is based on a HTML wrapping, you may use some formatting tags, if you want. In order to display them correctly, you must use a native UI manager somewhere in your code.
typeis the type of the message, that is, which image icon and font colors will be used. This is set according to the
positionis the window position. This parameter expects one of the values in
durationis the duration of the message display in milliseconds.
No complicated procedures involved.
Multiple messages notifications support is provided by a notification queue system, where only a single message notification is shown per time. We can see this manager in lines 2 and 3 of the previous code. Please note that this notification manager handles the calls for methods of the
Telegraph class. After adding a message notification to the queue, there is no need of calling any methods of the message notification itself. To add a notification to the queue, we use the
public synchronized void add(Telegraph telegraph)
If there is no message notifications in the queue, this message notification is displayed right after the call of the
add method. Otherwise, it will be queued until there is no message notifications in display. Please note this is a simple first in first out queue, so no priorities are estabilished when adding message notifications.
The following screenshot refers to the execution of our example. With only three lines of code, we created a nice message notification for our application (click the image for full size view).
Some say a picture is worth a thousand words. Then I guess a video may be worth a thousand pictures. The following video shows how the message notification system looks like.
That's it! A nice, easy and yet powerful message notification library for your Java applications! I hope you like JTelegraph!
JTelegraph is licensed under the New BSD License. You may download the library in the compiled format or the source code as well.
|If you decide to download the JTelegraph in the compiled format, that is, a jar file, please check the available releases in the project page hosted at SourceForge.net.|
|Now, if you want to download the full source code, I kindly ask you to check the available source code repository in the project page hosted at Project Kenai. You may also contribute with code if you want.|
You can contact me through SourceForge.net. This website has an internal messaging system. If you prefer, you can also reach me through electronic mail.
# This is a Python code. Please, run the following # line in your favorite Python interpreter. # My e-mail should appear as result of this command. # Thanks a lot. "6365726564614075736572732e73662e6e6574".decode("hex")
If you didn't understand the code above, please try these other instructions:
// This is my e-mail. Please, replace the first (#) symbol // by (@) and the second and third (#) symbols by (.). // This was made in order to avoid spam. Thanks a lot. return "cereda # users # sf # net";
|You can also follow me in Twitter, if you want. Cheers!|