Skip to content

Commit

Permalink
Update readme, some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tduva committed Aug 10, 2016
1 parent 5e753d9 commit 31ba45e
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 37 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
------
Expand Down
96 changes: 62 additions & 34 deletions assets/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
40 changes: 37 additions & 3 deletions src/chatty/gui/emoji/EmojiUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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/"),
Expand All @@ -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<Emoticon> emotes, String code,
String filename, String name, String category) {
String url = EmojiUtil.class.getResource(set.internalPath+filename).toString();
Expand All @@ -49,7 +71,15 @@ public static void add(EmojiSet set, Collection<Emoticon> 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<Emoticon> makeEmoticons(String sourceId) {
Set<Emoticon> result = new HashSet<>();

Expand All @@ -68,7 +98,11 @@ public static Set<Emoticon> makeEmoticons(String sourceId) {
}



/**
* For testing.
*
* @param args
*/
public static void main(String[] args) {
Set<Emoticon> emotes = makeEmoticons("e1");
System.out.println(emotes.size());
Expand Down

0 comments on commit 31ba45e

Please sign in to comment.