diff --git a/README.md b/README.md index b1b5819ae..7c559bfcd 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,22 @@ External Libraries/Resources * License: CC-BY 3.0 (http://creativecommons.org/licenses/by/3.0/) +* Twitter Emoji Images + * Files: `gui/emoji/twemoji` + * Source: https://github.com/twitter/twemoji + * License: CC-BY 4.0 + (https://creativecommons.org/licenses/by/4.0/) + +* Emoji One Images + * Files: `gui/emoji/e1` + * Source: http://emojione.com/ + * License: CC-BY 4.0 + (https://creativecommons.org/licenses/by/4.0/) + +* Emoji Metadata based on EmojiOne emoji.json + * Source: https://github.com/Ranks/emojione/blob/master/emoji.json + * License: MIT + (https://opensource.org/licenses/MIT) Chatty ------ diff --git a/assets/readme.txt b/assets/readme.txt index 9db0ae583..89cf32453 100644 --- a/assets/readme.txt +++ b/assets/readme.txt @@ -79,40 +79,68 @@ Chatty is released under the MIT License, except for the parts mentioned below. External Libraries ------------------ -* JSON-Simple [lib/json-simple-*.jar] - Website: https://code.google.com/p/json-simple/) - License: "Apache License 2.0" - http://www.apache.org/licenses/LICENSE-2.0 - -* JIntellitype [lib/jintellitype-*.jar, Jintellitype*.dll] (only some versions) - Website: https://code.google.com/p/jintellitype/ - License: "Apache License 2.0" - http://www.apache.org/licenses/LICENSE-2.0 - -* Tyrus [lib/tyrus-standalone-client-1.12.jar] - Website: https://tyrus.java.net - License: "CDDL 1.1" and "GPL 2 with CPE" - https://tyrus.java.net/license.html - -* Favorites Icon [star.png] by Everaldo Coelho - Source: https://www.iconfinder.com/icons/17999/bookmark_favorite_star_icon - License: LGPL - http://www.gnu.org/licenses/lgpl.html - -* Misc Icons [list-add.png, list-remove.png, view-refresh.png, +* JSON-Simple: + * File: `assets/lib/json-simple-*.jar` + * Website: https://code.google.com/p/json-simple/ + * License: "Apache License 2.0" + (for the license text see the APACHE_LICENSE file + or http://www.apache.org/licenses/LICENSE-2.0). + +* JIntellitype: + * Files: `assets/lib/jintellitype-*.jar, Jintellitype*.dll` + * Website: https://code.google.com/p/jintellitype/ + * License: "Apache License 2.0" + (for the license text see the APACHE_LICENSE file + or http://www.apache.org/licenses/LICENSE-2.0). + +* Tyrus: + * Files: `assets/lib/tyrus-standalone-client-1.12.jar` + * Website: https://tyrus.java.net + * License: "CDDL 1.1" and "GPL 2 with CPE" + (see https://tyrus.java.net/license.html) + +* Favorites Icon by Everaldo Coelho: + * File: `star.png` + * Source: https://www.iconfinder.com/icons/17999/bookmark_favorite_star_icon + * License: LGPL + (for the license text see the LGPL file or + http://www.gnu.org/licenses/lgpl.html) + +* Misc Icons from the Tango Icon Theme: + * Files: `list-add.png, list-remove.png, view-refresh.png, help-browser.png, preferences-system.png, dialog-warning.png, go-down.png, go-up.png, go-next.png, - go-previous.png, go-home.png, go-web.png] from the Tango Icon Theme - Source: http://tango.freedesktop.org/Tango_Icon_Library - License: Released into the Public Domain - -* Misc Icons [edit.png, ok.png, no.png] from NUVOLA ICON THEME for KDE 3.x - by David Vignoni - Source: http://www.icon-king.com/projects/nuvola/ - License: LGPL - http://www.gnu.org/licenses/lgpl.html - -* Robot Icon [icon_bot.png] by Yusuke Kamiyamane - Source: https://www.iconfinder.com/icons/46205/robot_icon - License: CC-BY 3.0 + go-previous.png, go-home.png, go-web.png` + * Source: http://tango.freedesktop.org/Tango_Icon_Library + * License: Released into the Public Domain + +* Misc Icons from NUVOLA ICON THEME for KDE 3.x + by David Vignoni: + * Files: `edit.png, ok.png, no.png` + * Source: http://www.icon-king.com/projects/nuvola/ + * License: LGPL + (for the license text see the LGPL file or + http://www.gnu.org/licenses/lgpl.html) + +* Robot Icon by Yusuke Kamiyamane: + * File: `icon_bot.png` + * Source: https://www.iconfinder.com/icons/46205/robot_icon + * License: CC-BY 3.0 (http://creativecommons.org/licenses/by/3.0/) + +* Twitter Emoji Images + * Files: `gui/emoji/twemoji` + * Source: https://github.com/twitter/twemoji + * License: CC-BY 4.0 + (https://creativecommons.org/licenses/by/4.0/) + +* Emoji One Images + * Files: `gui/emoji/e1` + * Source: http://emojione.com/ + * License: CC-BY 4.0 + (https://creativecommons.org/licenses/by/4.0/) + +* Emoji Metadata based on EmojiOne emoji.json + * Source: https://github.com/Ranks/emojione/blob/master/emoji.json + * License: MIT + (https://opensource.org/licenses/MIT) \ No newline at end of file diff --git a/src/chatty/gui/emoji/EmojiUtil.java b/src/chatty/gui/emoji/EmojiUtil.java index 130fa58cd..cf2f6e6e7 100644 --- a/src/chatty/gui/emoji/EmojiUtil.java +++ b/src/chatty/gui/emoji/EmojiUtil.java @@ -8,13 +8,24 @@ import java.util.logging.Logger; /** - * + * Creates Emoticon objects for the selected Emoji Set. + * + * The code in this file has been pre-processed since it appears to be kind of + * inconvenient to get a list of assets from a jar file. + * + * Emoji Metadata (description/category) in this file based on + * https://github.com/Ranks/emojione/blob/master/emoji.json (MIT License) + * * @author tduva */ public class EmojiUtil { private static final Logger LOGGER = Logger.getLogger(EmojiUtil.class.getName()); + /** + * One Emoji set specifiying an identifier, human-readable name and image + * path in the jar relative to this file. + */ public enum EmojiSet { TWEMOJI("twemoji", "Twitter Emoji", "twemoji/72x72/"), @@ -31,6 +42,17 @@ public enum EmojiSet { } } + /** + * Creates an Emoticon of type EMOJI with the given info and adds it to the + * Collection. + * + * @param set The Emoji Set containing info on which set it is + * @param emotes The Collection to add the Emoticon to + * @param code The unicode characters as escaped string + * @param filename The filename of the image + * @param name A short description of the Emoji, or null + * @param category The category of the Emoji, or null + */ public static void add(EmojiSet set, Collection emotes, String code, String filename, String name, String category) { String url = EmojiUtil.class.getResource(set.internalPath+filename).toString(); @@ -49,7 +71,15 @@ public static void add(EmojiSet set, Collection emotes, String code, emotes.add(b.build()); } - + /** + * Create Emoticon objects for the Emoji in the given set. + * + * If no valid set is given, then the returned Set will be empty (used for + * example when no Emoji are to be used). + * + * @param sourceId The name of the Emoji set + * @return A Set of Emoticon objects representing the selected Emoji + */ public static Set makeEmoticons(String sourceId) { Set result = new HashSet<>(); @@ -68,7 +98,11 @@ public static Set makeEmoticons(String sourceId) { } - + /** + * For testing. + * + * @param args + */ public static void main(String[] args) { Set emotes = makeEmoticons("e1"); System.out.println(emotes.size());