- Mode dynamic way to declare new icons.

main
Paulo Gustavo Veiga 2011-03-21 17:38:05 -03:00
parent 5d0d837062
commit 107e559364
31 changed files with 95 additions and 301 deletions

View File

@ -43,7 +43,6 @@ mindplot.ImageIcon = function(iconModel, topic, designer) {
{
removeImage.addEvent('click', function(event) {
// @Todo: actionRunner should not be exposed ...
var actionRunner = designer._actionRunner;
var command = new mindplot.commands.RemoveIconFromTopicCommand(this._topic.getId(), iconModel);
actionRunner.execute(command);
@ -88,8 +87,8 @@ mindplot.ImageIcon.prototype.initialize = function() {
};
mindplot.ImageIcon.prototype._getImageUrl = function(id) {
return mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[id];
mindplot.ImageIcon.prototype._getImageUrl = function(iconId) {
return "../icons/"+iconId+".png";
};
mindplot.ImageIcon.prototype.getModel = function() {
@ -97,15 +96,15 @@ mindplot.ImageIcon.prototype.getModel = function() {
};
mindplot.ImageIcon.prototype._getNextFamilyIconId = function(id) {
mindplot.ImageIcon.prototype._getNextFamilyIconId = function(iconId) {
var familyIcons = this._getFamilyIcons(id);
var familyIcons = this._getFamilyIcons(iconId);
core.assert(familyIcons != null, "Family Icon not found!");
var result = null;
for (var i = 0; i < familyIcons.length && result == null; i++)
{
if (familyIcons[i] == id) {
if (familyIcons[i] == iconId) {
var nextIconId;
//Is last one?
if (i == (familyIcons.length - 1)) {
@ -120,16 +119,18 @@ mindplot.ImageIcon.prototype._getNextFamilyIconId = function(id) {
return result;
};
mindplot.ImageIcon.prototype._getFamilyIcons = function(id) {
core.assert(id != null, "id must not be null");
core.assert(id.indexOf("_") != -1, "Invalid icon id (it must contain '_')");
mindplot.ImageIcon.prototype._getFamilyIcons = function(iconId) {
core.assert(iconId != null, "id must not be null");
core.assert(iconId.indexOf("_") != -1, "Invalid icon id (it must contain '_')");
var result = null;
for (var i = 0; i < mindplot.ImageIcon.prototype.ICON_FAMILIES.length; i++)
{
var family = mindplot.ImageIcon.prototype.ICON_FAMILIES[i];
var familyPrefix = id.substr(0, id.indexOf("_"));
if (family[0].match(familyPrefix) != null) {
result = family;
var iconFamilyId = iconId.substr(0, iconId.indexOf("_"));
if (family.id == iconFamilyId) {
result = family.icons;
break;
}
}
@ -146,223 +147,7 @@ mindplot.ImageIcon.prototype.getUiId = function()
return this._uiId;
};
mindplot.ImageIcon.ICON_FAMILIY_FLAG_PREFIX = 'flag_';
mindplot.ImageIcon.ICON_FAMILIY_BULLET_PREFIX = 'bullet_';
mindplot.ImageIcon.ICON_FAMILIY_TAG_PREFIX = 'tag_';
mindplot.ImageIcon.ICON_FAMILIY_FACE_PREFIX = 'face_';
mindplot.ImageIcon.ICON_FAMILIY_FACE_FUNY_PREFIX = 'facefuny_';
mindplot.ImageIcon.ICON_FAMILIY_ARROW_PREFIX = 'arrow_';
mindplot.ImageIcon.ICON_FAMILIY_ARROWC_PREFIX = 'arrowc_';
mindplot.ImageIcon.ICON_FAMILIY_CHART_PREFIX = 'chart_';
mindplot.ImageIcon.ICON_FAMILIY_ONOFF_PREFIX = 'onoff_';
mindplot.ImageIcon.ICON_FAMILIY_THUMB_PREFIX = 'thumb_';
mindplot.ImageIcon.ICON_FAMILIY_MONEY_PREFIX = 'money_';
mindplot.ImageIcon.ICON_FAMILIY_NUMBER_PREFIX = 'number_';
mindplot.ImageIcon.ICON_FAMILIY_TICK_PREFIX = 'tick_';
mindplot.ImageIcon.ICON_FAMILIY_CONNECT_PREFIX = 'conn_';
mindplot.ImageIcon.ICON_FAMILIY_BULB_PREFIX = 'bulb_'
mindplot.ImageIcon.ICON_FAMILIY_TASK_PREFIX = 'task_';
mindplot.ImageIcon.ICON_TYPE_ARROW_UP = mindplot.ImageIcon.ICON_FAMILIY_ARROW_PREFIX + 'up';
mindplot.ImageIcon.ICON_TYPE_ARROW_DOWN = mindplot.ImageIcon.ICON_FAMILIY_ARROW_PREFIX + 'down';
mindplot.ImageIcon.ICON_TYPE_ARROW_LEFT = mindplot.ImageIcon.ICON_FAMILIY_ARROW_PREFIX + 'left';
mindplot.ImageIcon.ICON_TYPE_ARROW_RIGHT = mindplot.ImageIcon.ICON_FAMILIY_ARROW_PREFIX + 'right';
mindplot.ImageIcon.ICON_TYPE_ARROWC_TURN_LEFT = mindplot.ImageIcon.ICON_FAMILIY_ARROWC_PREFIX + 'turn_left';
mindplot.ImageIcon.ICON_TYPE_ARROWC_TURN_RIGHT = mindplot.ImageIcon.ICON_FAMILIY_ARROWC_PREFIX + 'turn_right';
mindplot.ImageIcon.ICON_TYPE_ARROWC_UNDO = mindplot.ImageIcon.ICON_FAMILIY_ARROWC_PREFIX + 'undo';
mindplot.ImageIcon.ICON_TYPE_ARROWC_ANTICLOCKWISE = mindplot.ImageIcon.ICON_FAMILIY_ARROWC_PREFIX + 'rotate_anticlockwise';
mindplot.ImageIcon.ICON_TYPE_ARROWC_CLOCKWISE = mindplot.ImageIcon.ICON_FAMILIY_ARROWC_PREFIX + 'rotate_clockwise';
mindplot.ImageIcon.ICON_TYPE_FACE_PLAIN = mindplot.ImageIcon.ICON_FAMILIY_FACE_PREFIX + 'plain';
mindplot.ImageIcon.ICON_TYPE_FACE_SAD = mindplot.ImageIcon.ICON_FAMILIY_FACE_PREFIX + 'sad';
mindplot.ImageIcon.ICON_TYPE_FACE_SMILE_BIG = mindplot.ImageIcon.ICON_FAMILIY_FACE_PREFIX + 'smilebig';
mindplot.ImageIcon.ICON_TYPE_FACE_SMILE = mindplot.ImageIcon.ICON_FAMILIY_FACE_PREFIX + 'smile';
mindplot.ImageIcon.ICON_TYPE_FACE_SURPRISE = mindplot.ImageIcon.ICON_FAMILIY_FACE_PREFIX + 'surprise';
mindplot.ImageIcon.ICON_TYPE_FACE_WINK = mindplot.ImageIcon.ICON_FAMILIY_FACE_PREFIX + 'wink';
mindplot.ImageIcon.ICON_TYPE_FACE_CRYING = mindplot.ImageIcon.ICON_FAMILIY_FACE_PREFIX + 'crying';
mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_ANGEL = mindplot.ImageIcon.ICON_FAMILIY_FACE_FUNY_PREFIX + 'angel';
mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_DEVIL = mindplot.ImageIcon.ICON_FAMILIY_FACE_FUNY_PREFIX + 'devilish';
mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_GLASSES = mindplot.ImageIcon.ICON_FAMILIY_FACE_FUNY_PREFIX + 'glasses';
mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_GRIN = mindplot.ImageIcon.ICON_FAMILIY_FACE_FUNY_PREFIX + 'grin';
mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_KISS = mindplot.ImageIcon.ICON_FAMILIY_FACE_FUNY_PREFIX + 'kiss';
mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_MONKEY = mindplot.ImageIcon.ICON_FAMILIY_FACE_FUNY_PREFIX + 'monkey';
mindplot.ImageIcon.ICON_TYPE_CHART_BAR = mindplot.ImageIcon.ICON_FAMILIY_CHART_PREFIX + 'bar';
mindplot.ImageIcon.ICON_TYPE_CHART_LINE = mindplot.ImageIcon.ICON_FAMILIY_CHART_PREFIX + 'line';
mindplot.ImageIcon.ICON_TYPE_CHART_CURVE = mindplot.ImageIcon.ICON_FAMILIY_CHART_PREFIX + 'curve';
mindplot.ImageIcon.ICON_TYPE_CHART_PIE = mindplot.ImageIcon.ICON_FAMILIY_CHART_PREFIX + 'pie';
mindplot.ImageIcon.ICON_TYPE_CHART_ORGANISATION = mindplot.ImageIcon.ICON_FAMILIY_CHART_PREFIX + 'organisation';
mindplot.ImageIcon.ICON_TYPE_FLAG_BLUE = mindplot.ImageIcon.ICON_FAMILIY_FLAG_PREFIX + 'blue';
mindplot.ImageIcon.ICON_TYPE_FLAG_GREEN = mindplot.ImageIcon.ICON_FAMILIY_FLAG_PREFIX + 'green';
mindplot.ImageIcon.ICON_TYPE_FLAG_ORANGE = mindplot.ImageIcon.ICON_FAMILIY_FLAG_PREFIX + 'orange';
mindplot.ImageIcon.ICON_TYPE_FLAG_PINK = mindplot.ImageIcon.ICON_FAMILIY_FLAG_PREFIX + 'pink';
mindplot.ImageIcon.ICON_TYPE_FLAG_PURPLE = mindplot.ImageIcon.ICON_FAMILIY_FLAG_PREFIX + 'purple';
mindplot.ImageIcon.ICON_TYPE_FLAG_YELLOW = mindplot.ImageIcon.ICON_FAMILIY_FLAG_PREFIX + 'yellow';
mindplot.ImageIcon.ICON_TYPE_BULLET_BLACK = mindplot.ImageIcon.ICON_FAMILIY_BULLET_PREFIX + 'black';
mindplot.ImageIcon.ICON_TYPE_BULLET_BLUE = mindplot.ImageIcon.ICON_FAMILIY_BULLET_PREFIX + 'blue';
mindplot.ImageIcon.ICON_TYPE_BULLET_GREEN = mindplot.ImageIcon.ICON_FAMILIY_BULLET_PREFIX + 'green';
mindplot.ImageIcon.ICON_TYPE_BULLET_ORANGE = mindplot.ImageIcon.ICON_FAMILIY_BULLET_PREFIX + 'orange';
mindplot.ImageIcon.ICON_TYPE_BULLET_RED = mindplot.ImageIcon.ICON_FAMILIY_BULLET_PREFIX + 'red';
mindplot.ImageIcon.ICON_TYPE_BULLET_PINK = mindplot.ImageIcon.ICON_FAMILIY_BULLET_PREFIX + 'pink';
mindplot.ImageIcon.ICON_TYPE_BULLET_PURPLE = mindplot.ImageIcon.ICON_FAMILIY_BULLET_PREFIX + 'purple';
mindplot.ImageIcon.ICON_TYPE_TAG_BLUE = mindplot.ImageIcon.ICON_FAMILIY_TAG_PREFIX + 'blue';
mindplot.ImageIcon.ICON_TYPE_TAG_GREEN = mindplot.ImageIcon.ICON_FAMILIY_TAG_PREFIX + 'green';
mindplot.ImageIcon.ICON_TYPE_TAG_ORANGE = mindplot.ImageIcon.ICON_FAMILIY_TAG_PREFIX + 'orange';
mindplot.ImageIcon.ICON_TYPE_TAG_RED = mindplot.ImageIcon.ICON_FAMILIY_TAG_PREFIX + 'red';
mindplot.ImageIcon.ICON_TYPE_TAG_PINK = mindplot.ImageIcon.ICON_FAMILIY_TAG_PREFIX + 'pink';
mindplot.ImageIcon.ICON_TYPE_TAG_YELLOW = mindplot.ImageIcon.ICON_FAMILIY_TAG_PREFIX + 'yellow';
mindplot.ImageIcon.ICON_TYPE_TAG_PURPLE = mindplot.ImageIcon.ICON_FAMILIY_TAG_PREFIX + 'purple';
mindplot.ImageIcon.ICON_TYPE_ONOFF_THUMB_UP = mindplot.ImageIcon.ICON_FAMILIY_THUMB_PREFIX + 'thumb_up';
mindplot.ImageIcon.ICON_TYPE_ONOFF_THUMB_DOWN = mindplot.ImageIcon.ICON_FAMILIY_THUMB_PREFIX + 'thumb_down';
mindplot.ImageIcon.ICON_TYPE_TICK_ON = mindplot.ImageIcon.ICON_FAMILIY_TICK_PREFIX + 'tick';
mindplot.ImageIcon.ICON_TYPE_TICK_OFF = mindplot.ImageIcon.ICON_FAMILIY_TICK_PREFIX + 'cross';
mindplot.ImageIcon.ICON_TYPE_BULB_ON = mindplot.ImageIcon.ICON_FAMILIY_BULB_PREFIX + 'light_on';
mindplot.ImageIcon.ICON_TYPE_BULB_OFF = mindplot.ImageIcon.ICON_FAMILIY_BULB_PREFIX + 'light_off';
mindplot.ImageIcon.ICON_TYPE_CONNECT_ON = mindplot.ImageIcon.ICON_FAMILIY_CONNECT_PREFIX + 'connect';
mindplot.ImageIcon.ICON_TYPE_CONNECT_OFF = mindplot.ImageIcon.ICON_FAMILIY_CONNECT_PREFIX + 'disconnect';
mindplot.ImageIcon.ICON_TYPE_ONOFF_CLOCK = mindplot.ImageIcon.ICON_FAMILIY_ONOFF_PREFIX + 'clock';
mindplot.ImageIcon.ICON_TYPE_ONOFF_CLOCK_RED = mindplot.ImageIcon.ICON_FAMILIY_ONOFF_PREFIX + 'clock_red';
mindplot.ImageIcon.ICON_TYPE_ONOFF_ADD = mindplot.ImageIcon.ICON_FAMILIY_ONOFF_PREFIX + 'add';
mindplot.ImageIcon.ICON_TYPE_ONOFF_DELETE = mindplot.ImageIcon.ICON_FAMILIY_ONOFF_PREFIX + 'delete';
mindplot.ImageIcon.ICON_TYPE_MONEY_MONEY = mindplot.ImageIcon.ICON_FAMILIY_MONEY_PREFIX + 'money';
mindplot.ImageIcon.ICON_TYPE_MONEY_DOLLAR = mindplot.ImageIcon.ICON_FAMILIY_MONEY_PREFIX + 'dollar';
mindplot.ImageIcon.ICON_TYPE_MONEY_EURO = mindplot.ImageIcon.ICON_FAMILIY_MONEY_PREFIX + 'euro';
mindplot.ImageIcon.ICON_TYPE_MONEY_POUND = mindplot.ImageIcon.ICON_FAMILIY_MONEY_PREFIX + 'pound';
mindplot.ImageIcon.ICON_TYPE_MONEY_YEN = mindplot.ImageIcon.ICON_FAMILIY_MONEY_PREFIX + 'yen';
mindplot.ImageIcon.ICON_TYPE_MONEY_COINS = mindplot.ImageIcon.ICON_FAMILIY_MONEY_PREFIX + 'coins';
mindplot.ImageIcon.ICON_TYPE_MONEY_RUBY = mindplot.ImageIcon.ICON_FAMILIY_MONEY_PREFIX + 'ruby';
mindplot.ImageIcon.ICON_TYPE_NUMBER_ONE = mindplot.ImageIcon.ICON_FAMILIY_NUMBER_PREFIX + 'one';
mindplot.ImageIcon.ICON_TYPE_NUMBER_TWO = mindplot.ImageIcon.ICON_FAMILIY_NUMBER_PREFIX + 'two';
mindplot.ImageIcon.ICON_TYPE_NUMBER_THREE = mindplot.ImageIcon.ICON_FAMILIY_NUMBER_PREFIX + 'three';
mindplot.ImageIcon.ICON_TYPE_NUMBER_FOUR = mindplot.ImageIcon.ICON_FAMILIY_NUMBER_PREFIX + 'four';
mindplot.ImageIcon.ICON_TYPE_NUMBER_FIVE = mindplot.ImageIcon.ICON_FAMILIY_NUMBER_PREFIX + 'five';
mindplot.ImageIcon.ICON_TYPE_NUMBER_SIX = mindplot.ImageIcon.ICON_FAMILIY_NUMBER_PREFIX + 'six';
mindplot.ImageIcon.ICON_TYPE_NUMBER_SEVEN = mindplot.ImageIcon.ICON_FAMILIY_NUMBER_PREFIX + 'seven';
mindplot.ImageIcon.ICON_TYPE_NUMBER_EIGHT = mindplot.ImageIcon.ICON_FAMILIY_NUMBER_PREFIX + 'eight';
mindplot.ImageIcon.ICON_TYPE_NUMBER_NINE = mindplot.ImageIcon.ICON_FAMILIY_NUMBER_PREFIX + 'nine';
mindplot.ImageIcon.ICON_TYPE_TASK_ONE = mindplot.ImageIcon.ICON_FAMILIY_TASK_PREFIX + 'one';
mindplot.ImageIcon.ICON_TYPE_TASK_TWO = mindplot.ImageIcon.ICON_FAMILIY_TASK_PREFIX + 'two';
mindplot.ImageIcon.ICON_TYPE_TASK_THREE = mindplot.ImageIcon.ICON_FAMILIY_TASK_PREFIX + 'three';
mindplot.ImageIcon.ICON_TYPE_TASK_FOUR = mindplot.ImageIcon.ICON_FAMILIY_TASK_PREFIX + 'four';
mindplot.ImageIcon.ICON_TYPE_TASK_FIVE = mindplot.ImageIcon.ICON_FAMILIY_TASK_PREFIX + 'five';
mindplot.ImageIcon.prototype.ICON_FAMILIES = [{"id": "flag", "icons" : ["flag_blue","flag_green","flag_orange","flag_pink","flag_purple","flag_yellow"]},{"id": "bullet", "icons" : ["bullet_black","bullet_blue","bullet_green","bullet_orange","bullet_red","bullet_pink","bullet_purple"]},{"id": "tag", "icons" : ["tag_blue","tag_green","tag_orange","tag_red","tag_pink","tag_yellow"]},{"id": "face", "icons" : ["face_plain","face_sad","face_crying","face_smile","face_surprise","face_wink"]},{"id": "funy", "icons" : ["funy_angel","funy_devilish","funy_glasses","funy_grin","funy_kiss","funy_monkey"]},{"id": "arrow", "icons" : ["arrow_up","arrow_down","arrow_left","arrow_right"]},{"id": "arrowc", "icons" : ["arrowc_rotate_anticlockwise","arrowc_rotate_clockwise","arrowc_turn_left","arrowc_turn_right"]},{"id": "conn", "icons" : ["conn_connect","conn_disconnect"]},{"id": "bulb", "icons" : ["bulb_light_on","bulb_light_off"]},{"id": "thumb", "icons" : ["thumb_thumb_up","thumb_thumb_down"]},{"id": "tick", "icons" : ["tick_tick","tick_cross"]},{"id": "onoff", "icons" : ["onoff_clock","onoff_clock_red","onoff_add","onoff_delete"]},{"id": "money", "icons" : ["money_money","money_dollar","money_euro","money_pound","money_yen","money_coins","money_ruby"]},{"id": "chart", "icons" : ["chart_bar","chart_line","chart_curve","chart_pie","chart_organisation"]},]
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP = new Object();
//FLAG
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FLAG_BLUE] = "../icons/flag_blue.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FLAG_GREEN] = "../icons/flag_green.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FLAG_ORANGE] = "../icons/flag_orange.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FLAG_PINK] = "../icons/flag_pink.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FLAG_PURPLE] = "../icons/flag_purple.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FLAG_YELLOW] = "../icons/flag_yellow.png";
//BULLET
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_BULLET_BLACK] = "../icons/bullet_black.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_BULLET_BLUE] = "../icons/bullet_blue.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_BULLET_GREEN] = "../icons/bullet_blue.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_BULLET_ORANGE] = "../icons/bullet_green.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_BULLET_RED] = "../icons/bullet_orange.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_BULLET_PINK] = "../icons/bullet_pink.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_BULLET_PURPLE] = "../icons/bullet_purple.png";
//TAGS
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_TAG_BLUE] = "../icons/tag_blue.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_TAG_GREEN] = "../icons/tag_green.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_TAG_ORANGE] = "../icons/tag_orange.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_TAG_RED] = "../icons/tag_red.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_TAG_PINK] = "../icons/tag_pink.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_TAG_YELLOW] = "../icons/tag_yellow.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_TAG_PURPLE] = "../icons/tag_purple.png";
//FACES
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_ANGEL] = "../icons/face-_angel.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_DEVIL] = "../icons/face_devilish.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_GLASSES] = "../icons/face_glasses.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_KISS] = "../icons/face_kiss.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_MONKEY] = "../icons/face_monkey.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FACE_PLAIN] = "../icons/face_plain.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FACE_CRYING] = "../icons/face_crying.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FACE_SAD] = "../icons/face_sad.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FACE_SMILE] = "../icons/face_smile.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FACE_SURPRISE] = "../icons/face_surprise.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_FACE_WINK] = "../icons/face_wink.png";
//ARROWS
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_ARROW_UP] = "../icons/arrow_up.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_ARROW_DOWN] = "../icons/arrow_down.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_ARROW_LEFT] = "../icons/arrow_left.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_ARROW_RIGHT] = "../icons/arrow_right.png";
// ARROWS COMPLEX.
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_ARROWC_TURN_LEFT] = "../icons/arrow_turn_left.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_ARROWC_TURN_RIGHT] = "../icons/arrow_turn_right.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_ARROWC_UNDO] = "../icons/arrow_undo.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_ARROWC_ANTICLOCKWISE] = "../icons/arrow_rotate_anticlockwise.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_ARROWC_CLOCKWISE] = "../icons/arrow_rotate_clockwise.png";
//CHARTS
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_CHART_BAR] = "../icons/chart_bar.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_CHART_LINE] = "../icons/chart_line.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_CHART_CURVE] = "../icons/chart_curve.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_CHART_PIE] = "../icons/chart_pie.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_CHART_ORGANISATION] = "../icons/chart_organisation.png";
// THUMB
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_ONOFF_THUMB_UP] = "../icons/thumb_up.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_ONOFF_THUMB_DOWN] = "../icons/thumb_down.png";
// ON OFF
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_TICK_ON] = "../icons/tick.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_TICK_OFF] = "../icons/cross.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_BULB_ON] = "../icons/lightbulb.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_BULB_OFF] = "../icons/lightbulb_off.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_CONNECT_ON] = "../icons/connect.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_CONNECT_OFF] = "../icons/disconnect.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_ONOFF_CLOCK] = "../icons/clock.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_ONOFF_CLOCK_RED] = "../icons/clock_red.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_ONOFF_ADD] = "../icons/add.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_ONOFF_DELETE] = "../icons/delete.png";
//MONEY
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_MONEY_MONEY] = "../icons/money.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_MONEY_DOLLAR] = "../icons/money_dollar.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_MONEY_EURO] = "../icons/money_euro.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_MONEY_POUND] = "../icons/money_pound.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_MONEY_YEN] = "../icons/money_yen.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_MONEY_COINS] = "../icons/coins.png";
mindplot.ImageIcon.prototype.ICON_IMAGE_MAP[mindplot.ImageIcon.ICON_TYPE_MONEY_RUBY] = "../icons/ruby.png";
//FAMILIES
mindplot.ImageIcon.prototype.ICON_FLAG_FAMILY = [mindplot.ImageIcon.ICON_TYPE_FLAG_BLUE, mindplot.ImageIcon.ICON_TYPE_FLAG_GREEN,mindplot.ImageIcon.ICON_TYPE_FLAG_ORANGE,mindplot.ImageIcon.ICON_TYPE_FLAG_PINK, mindplot.ImageIcon.ICON_TYPE_FLAG_PURPLE, mindplot.ImageIcon.ICON_TYPE_FLAG_YELLOW];
mindplot.ImageIcon.prototype.ICON_TAG_FAMILY = [mindplot.ImageIcon.ICON_TYPE_TAG_BLUE, mindplot.ImageIcon.ICON_TYPE_TAG_GREEN,mindplot.ImageIcon.ICON_TYPE_TAG_ORANGE,mindplot.ImageIcon.ICON_TYPE_TAG_PINK, mindplot.ImageIcon.ICON_TYPE_TAG_PURPLE, mindplot.ImageIcon.ICON_TYPE_TAG_YELLOW];
mindplot.ImageIcon.prototype.ICON_BULLET_FAMILY = [mindplot.ImageIcon.ICON_TYPE_BULLET_BLACK, mindplot.ImageIcon.ICON_TYPE_BULLET_BLUE, mindplot.ImageIcon.ICON_TYPE_BULLET_GREEN,mindplot.ImageIcon.ICON_TYPE_BULLET_ORANGE,mindplot.ImageIcon.ICON_TYPE_BULLET_RED, mindplot.ImageIcon.ICON_TYPE_BULLET_PINK, mindplot.ImageIcon.ICON_TYPE_BULLET_PURPLE];
mindplot.ImageIcon.prototype.ICON_FUNY_FACE_FAMILY = [mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_ANGEL, mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_DEVIL, mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_GLASSES, mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_KISS, mindplot.ImageIcon.ICON_TYPE_FACE_FUNY_MONKEY];
mindplot.ImageIcon.prototype.ICON_FACE_FAMILY = [mindplot.ImageIcon.ICON_TYPE_FACE_PLAIN, mindplot.ImageIcon.ICON_TYPE_FACE_SAD, mindplot.ImageIcon.ICON_TYPE_FACE_CRYING, mindplot.ImageIcon.ICON_TYPE_FACE_SMILE, mindplot.ImageIcon.ICON_TYPE_FACE_SURPRISE, mindplot.ImageIcon.ICON_TYPE_FACE_WINK];
mindplot.ImageIcon.prototype.ICON_ARROW_FAMILY = [mindplot.ImageIcon.ICON_TYPE_ARROW_UP, mindplot.ImageIcon.ICON_TYPE_ARROW_DOWN, mindplot.ImageIcon.ICON_TYPE_ARROW_LEFT, mindplot.ImageIcon.ICON_TYPE_ARROW_RIGHT];
mindplot.ImageIcon.prototype.ICON_COMPLEX_ARROW_FAMILY = [mindplot.ImageIcon.ICON_TYPE_ARROWC_UNDO, mindplot.ImageIcon.ICON_TYPE_ARROWC_ANTICLOCKWISE, mindplot.ImageIcon.ICON_TYPE_ARROWC_CLOCKWISE,mindplot.ImageIcon.ICON_TYPE_ARROWC_TURN_LEFT, mindplot.ImageIcon.ICON_TYPE_ARROWC_TURN_RIGHT];
mindplot.ImageIcon.prototype.ICON_CHART_FAMILY = [mindplot.ImageIcon.ICON_TYPE_CHART_BAR, mindplot.ImageIcon.ICON_TYPE_CHART_LINE, mindplot.ImageIcon.ICON_TYPE_CHART_CURVE, mindplot.ImageIcon.ICON_TYPE_CHART_PIE, mindplot.ImageIcon.ICON_TYPE_CHART_ORGANISATION];
mindplot.ImageIcon.prototype.ICON_TICK_FAMILY = [ mindplot.ImageIcon.ICON_TYPE_TICK_ON, mindplot.ImageIcon.ICON_TYPE_TICK_OFF];
mindplot.ImageIcon.prototype.ICON_CONNECT_FAMILY = [ mindplot.ImageIcon.ICON_TYPE_CONNECT_ON, mindplot.ImageIcon.ICON_TYPE_CONNECT_OFF];
mindplot.ImageIcon.prototype.ICON_BULB_FAMILY = [ mindplot.ImageIcon.ICON_TYPE_BULB_ON, mindplot.ImageIcon.ICON_TYPE_BULB_OFF];
mindplot.ImageIcon.prototype.ICON_ONOFF_FAMILY = [ mindplot.ImageIcon.ICON_TYPE_ONOFF_CLOCK, mindplot.ImageIcon.ICON_TYPE_ONOFF_CLOCK_RED, mindplot.ImageIcon.ICON_TYPE_ONOFF_ADD, mindplot.ImageIcon.ICON_TYPE_ONOFF_DELETE];
mindplot.ImageIcon.prototype.ICON_THUMB_FAMILY = [mindplot.ImageIcon.ICON_TYPE_ONOFF_THUMB_UP, mindplot.ImageIcon.ICON_TYPE_ONOFF_THUMB_DOWN];
mindplot.ImageIcon.prototype.ICON_MONEY_FAMILY = [mindplot.ImageIcon.ICON_TYPE_MONEY_MONEY,mindplot.ImageIcon.ICON_TYPE_MONEY_DOLLAR,mindplot.ImageIcon.ICON_TYPE_MONEY_EURO,mindplot.ImageIcon.ICON_TYPE_MONEY_POUND,mindplot.ImageIcon.ICON_TYPE_MONEY_YEN,mindplot.ImageIcon.ICON_TYPE_MONEY_COINS,mindplot.ImageIcon.ICON_TYPE_MONEY_RUBY];
mindplot.ImageIcon.prototype.ICON_FAMILIES = [mindplot.ImageIcon.prototype.ICON_FACE_FAMILY, mindplot.ImageIcon.prototype.ICON_FUNY_FACE_FAMILY,mindplot.ImageIcon.prototype.ICON_ARROW_FAMILY,mindplot.ImageIcon.prototype.ICON_COMPLEX_ARROW_FAMILY, mindplot.ImageIcon.prototype.ICON_CONNECT_FAMILY,mindplot.ImageIcon.prototype.ICON_BULB_FAMILY,mindplot.ImageIcon.prototype.ICON_THUMB_FAMILY, mindplot.ImageIcon.prototype.ICON_TICK_FAMILY,mindplot.ImageIcon.prototype.ICON_ONOFF_FAMILY, mindplot.ImageIcon.prototype.ICON_MONEY_FAMILY, mindplot.ImageIcon.prototype.ICON_CHART_FAMILY, mindplot.ImageIcon.prototype.ICON_FLAG_FAMILY, mindplot.ImageIcon.prototype.ICON_BULLET_FAMILY, mindplot.ImageIcon.prototype.ICON_TAG_FAMILY];

View File

@ -19,35 +19,20 @@
package com.wisemapping.model;
public enum IconFamily {
FLAG("FLAG","flag_"),
BULLET("BULLET","bullet_"),
TAG("TAG","tag_"),
NUMBER("NUMBER","number_"),
SMILEY("FACE","face_"),
ARROW("ARROW","arrow_"),
ARROWC("ARROWC","arrowc_"),
CONN("CONN","conn_"),
BULB("BULB","bulb_"),
THUMB("THUMB","thumb_"),
TICK("TICK","tick_"),
ONOFF("ONOFF","onoff_"),
MONEY("MONEY","money_"),
CHART("CHART","chart_"),
TASK("TASK","task_");
FLAG(),
BULLET(),
TAG(),
// NUMBER("NUMBER","number_"),
FACE(),
FUNY(),
ARROW(),
ARROWC(),
CONN(),
BULB(),
THUMB(),
TICK(),
ONOFF(),
MONEY(),
CHART();
private String prefix;
private String name;
IconFamily(String name, String prefix) {
this.name = name;
this.prefix = prefix;
}
public String getPrefix() {
return prefix;
}
public String getName() {
return name;
}
}

View File

@ -18,29 +18,24 @@
package com.wisemapping.model;
public class MindmapIcon
{
public class MindmapIcon {
private String name;
private IconFamily family;
MindmapIcon(IconFamily family, String name)
{
MindmapIcon(IconFamily family, String name) {
this.name = name;
this.family = family;
}
public String getName()
{
public String getName() {
return name;
}
public IconFamily getFamily()
{
public IconFamily getFamily() {
return family;
}
public String getId()
{
return family.getPrefix() + name;
public String getId() {
return family.name().toLowerCase() + "_" + name;
}
}

View File

@ -29,12 +29,12 @@ public class MindmapIcons {
private static Map<IconFamily, List<MindmapIcon>> iconsByFamily;
public static final MindmapIcon FACE_PLAIN = new MindmapIcon(IconFamily.SMILEY, "plain");
public static final MindmapIcon FACE_SAD = new MindmapIcon(IconFamily.SMILEY, "sad");
public static final MindmapIcon FACE_CRYING = new MindmapIcon(IconFamily.SMILEY, "crying");
public static final MindmapIcon FACE_SMILE = new MindmapIcon(IconFamily.SMILEY, "smile");
public static final MindmapIcon FACE_SURPRISE = new MindmapIcon(IconFamily.SMILEY, "surprise");
public static final MindmapIcon FACE_WINK = new MindmapIcon(IconFamily.SMILEY, "wink");
public static final MindmapIcon FACE_PLAIN = new MindmapIcon(IconFamily.FACE, "plain");
public static final MindmapIcon FACE_SAD = new MindmapIcon(IconFamily.FACE, "sad");
public static final MindmapIcon FACE_CRYING = new MindmapIcon(IconFamily.FACE, "crying");
public static final MindmapIcon FACE_SMILE = new MindmapIcon(IconFamily.FACE, "smile");
public static final MindmapIcon FACE_SURPRISE = new MindmapIcon(IconFamily.FACE, "surprise");
public static final MindmapIcon FACE_WINK = new MindmapIcon(IconFamily.FACE, "wink");
public static final MindmapIcon THUMB__UP = new MindmapIcon(IconFamily.THUMB, "thumb_up");
public static final MindmapIcon THUMB_DOWN = new MindmapIcon(IconFamily.THUMB, "thumb_down");
@ -44,13 +44,13 @@ public class MindmapIcons {
public static final MindmapIcon ARROW_LEFT = new MindmapIcon(IconFamily.ARROW, "left");
public static final MindmapIcon ARROW_RIGHT = new MindmapIcon(IconFamily.ARROW, "right");
public static final MindmapIcon TASK_ONE = new MindmapIcon(IconFamily.TASK, "one");
public static final MindmapIcon TASK_TWO = new MindmapIcon(IconFamily.TASK, "two");
public static final MindmapIcon TASK_THREE = new MindmapIcon(IconFamily.TASK, "three");
public static final MindmapIcon TASK_FOUR = new MindmapIcon(IconFamily.TASK, "four");
public static final MindmapIcon TASK_FIVE = new MindmapIcon(IconFamily.TASK, "five");
// public static final MindmapIcon TASK_ONE = new MindmapIcon(IconFamily.TASK, "one");
// public static final MindmapIcon TASK_TWO = new MindmapIcon(IconFamily.TASK, "two");
// public static final MindmapIcon TASK_THREE = new MindmapIcon(IconFamily.TASK, "three");
// public static final MindmapIcon TASK_FOUR = new MindmapIcon(IconFamily.TASK, "four");
// public static final MindmapIcon TASK_FIVE = new MindmapIcon(IconFamily.TASK, "five");
public static final MindmapIcon ARROWC_UNDO = new MindmapIcon(IconFamily.ARROWC, "undo");
// public static final MindmapIcon ARROWC_UNDO = new MindmapIcon(IconFamily.ARROWC, "undo");
public static final MindmapIcon ARROWC_ANTICLOCK_WISE = new MindmapIcon(IconFamily.ARROWC, "rotate_anticlockwise");
public static final MindmapIcon ARROWC_CLOCK_WISE = new MindmapIcon(IconFamily.ARROWC, "rotate_clockwise");
public static final MindmapIcon ARROWC_LEFT = new MindmapIcon(IconFamily.ARROWC, "turn_left");
@ -80,15 +80,23 @@ public class MindmapIcons {
public static final MindmapIcon TAG_PINK = new MindmapIcon(IconFamily.TAG, "pink");
public static final MindmapIcon TAG_YELLOW = new MindmapIcon(IconFamily.TAG, "yellow");
public static final MindmapIcon NUMBER_ONE = new MindmapIcon(IconFamily.NUMBER, "one");
public static final MindmapIcon NUMBER_TWO = new MindmapIcon(IconFamily.NUMBER, "two");
public static final MindmapIcon NUMBER_THREE = new MindmapIcon(IconFamily.NUMBER, "three");
public static final MindmapIcon NUMBER_FOUR = new MindmapIcon(IconFamily.NUMBER, "four");
public static final MindmapIcon NUMBER_FIVE = new MindmapIcon(IconFamily.NUMBER, "five");
public static final MindmapIcon NUMBER_SIX = new MindmapIcon(IconFamily.NUMBER, "six");
public static final MindmapIcon NUMBER_SEVEN = new MindmapIcon(IconFamily.NUMBER, "seven");
public static final MindmapIcon NUMBER_EIGHT = new MindmapIcon(IconFamily.NUMBER, "eight");
public static final MindmapIcon NUMBER_NINE = new MindmapIcon(IconFamily.NUMBER, "nine");
// public static final MindmapIcon NUMBER_ONE = new MindmapIcon(IconFamily.NUMBER, "one");
// public static final MindmapIcon NUMBER_TWO = new MindmapIcon(IconFamily.NUMBER, "two");
// public static final MindmapIcon NUMBER_THREE = new MindmapIcon(IconFamily.NUMBER, "three");
// public static final MindmapIcon NUMBER_FOUR = new MindmapIcon(IconFamily.NUMBER, "four");
// public static final MindmapIcon NUMBER_FIVE = new MindmapIcon(IconFamily.NUMBER, "five");
// public static final MindmapIcon NUMBER_SIX = new MindmapIcon(IconFamily.NUMBER, "six");
// public static final MindmapIcon NUMBER_SEVEN = new MindmapIcon(IconFamily.NUMBER, "seven");
// public static final MindmapIcon NUMBER_EIGHT = new MindmapIcon(IconFamily.NUMBER, "eight");
// public static final MindmapIcon NUMBER_NINE = new MindmapIcon(IconFamily.NUMBER, "nine");
public static final MindmapIcon FUNNY_ANGEL = new MindmapIcon(IconFamily.FUNY, "angel");
public static final MindmapIcon FUNNY_DEVILISH = new MindmapIcon(IconFamily.FUNY, "devilish");
public static final MindmapIcon FUNNY_GLASSES = new MindmapIcon(IconFamily.FUNY, "glasses");
public static final MindmapIcon FUNNY_GRIN = new MindmapIcon(IconFamily.FUNY, "grin");
public static final MindmapIcon FUNNY_KISS = new MindmapIcon(IconFamily.FUNY, "kiss");
public static final MindmapIcon FUNNY_MONKEY = new MindmapIcon(IconFamily.FUNY, "monkey");
public static final MindmapIcon FLAG_BLUE = new MindmapIcon(IconFamily.FLAG, "blue");
public static final MindmapIcon FLAG_GREEN = new MindmapIcon(IconFamily.FLAG, "green");

View File

Before

Width:  |  Height:  |  Size: 608 B

After

Width:  |  Height:  |  Size: 608 B

View File

Before

Width:  |  Height:  |  Size: 602 B

After

Width:  |  Height:  |  Size: 602 B

View File

Before

Width:  |  Height:  |  Size: 516 B

After

Width:  |  Height:  |  Size: 516 B

View File

Before

Width:  |  Height:  |  Size: 489 B

After

Width:  |  Height:  |  Size: 489 B

View File

Before

Width:  |  Height:  |  Size: 700 B

After

Width:  |  Height:  |  Size: 700 B

View File

Before

Width:  |  Height:  |  Size: 782 B

After

Width:  |  Height:  |  Size: 782 B

View File

Before

Width:  |  Height:  |  Size: 748 B

After

Width:  |  Height:  |  Size: 748 B

View File

Before

Width:  |  Height:  |  Size: 796 B

After

Width:  |  Height:  |  Size: 796 B

View File

Before

Width:  |  Height:  |  Size: 992 B

After

Width:  |  Height:  |  Size: 992 B

View File

Before

Width:  |  Height:  |  Size: 855 B

After

Width:  |  Height:  |  Size: 855 B

View File

Before

Width:  |  Height:  |  Size: 949 B

After

Width:  |  Height:  |  Size: 949 B

View File

Before

Width:  |  Height:  |  Size: 905 B

After

Width:  |  Height:  |  Size: 905 B

View File

Before

Width:  |  Height:  |  Size: 919 B

After

Width:  |  Height:  |  Size: 919 B

View File

Before

Width:  |  Height:  |  Size: 784 B

After

Width:  |  Height:  |  Size: 784 B

View File

Before

Width:  |  Height:  |  Size: 732 B

After

Width:  |  Height:  |  Size: 732 B

View File

Before

Width:  |  Height:  |  Size: 738 B

After

Width:  |  Height:  |  Size: 738 B

View File

Before

Width:  |  Height:  |  Size: 592 B

After

Width:  |  Height:  |  Size: 592 B

View File

Before

Width:  |  Height:  |  Size: 733 B

After

Width:  |  Height:  |  Size: 733 B

View File

Before

Width:  |  Height:  |  Size: 882 B

After

Width:  |  Height:  |  Size: 882 B

View File

Before

Width:  |  Height:  |  Size: 889 B

After

Width:  |  Height:  |  Size: 889 B

View File

Before

Width:  |  Height:  |  Size: 715 B

After

Width:  |  Height:  |  Size: 715 B

View File

Before

Width:  |  Height:  |  Size: 601 B

After

Width:  |  Height:  |  Size: 601 B

View File

Before

Width:  |  Height:  |  Size: 619 B

After

Width:  |  Height:  |  Size: 619 B

View File

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 655 B

View File

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 537 B

View File

@ -461,7 +461,7 @@ function buildIconChooser() {
var count = 0;
for (var i = 0; i < mindplot.ImageIcon.prototype.ICON_FAMILIES.length; i = i + 1)
{
var familyIcons = mindplot.ImageIcon.prototype.ICON_FAMILIES[i];
var familyIcons = mindplot.ImageIcon.prototype.ICON_FAMILIES[i].icons;
for (var j = 0; j < familyIcons.length; j = j + 1)
{
// Separate icons by line ...

View File

@ -12,6 +12,8 @@ import java.util.List;
@Test
public class IconsTest {
final private static String CURRENT_JSON_ICONS = "[{\"id\": \"flag\", \"icons\" : [\"flag_blue\",\"flag_green\",\"flag_orange\",\"flag_pink\",\"flag_purple\",\"flag_yellow\"]},{\"id\": \"bullet\", \"icons\" : [\"bullet_black\",\"bullet_blue\",\"bullet_green\",\"bullet_orange\",\"bullet_red\",\"bullet_pink\",\"bullet_purple\"]},{\"id\": \"tag\", \"icons\" : [\"tag_blue\",\"tag_green\",\"tag_orange\",\"tag_red\",\"tag_pink\",\"tag_yellow\"]},{\"id\": \"face\", \"icons\" : [\"face_plain\",\"face_sad\",\"face_crying\",\"face_smile\",\"face_surprise\",\"face_wink\"]},{\"id\": \"funy\", \"icons\" : [\"funy_angel\",\"funy_devilish\",\"funy_glasses\",\"funy_grin\",\"funy_kiss\",\"funy_monkey\"]},{\"id\": \"arrow\", \"icons\" : [\"arrow_up\",\"arrow_down\",\"arrow_left\",\"arrow_right\"]},{\"id\": \"arrowc\", \"icons\" : [\"arrowc_rotate_anticlockwise\",\"arrowc_rotate_clockwise\",\"arrowc_turn_left\",\"arrowc_turn_right\"]},{\"id\": \"conn\", \"icons\" : [\"conn_connect\",\"conn_disconnect\"]},{\"id\": \"bulb\", \"icons\" : [\"bulb_light_on\",\"bulb_light_off\"]},{\"id\": \"thumb\", \"icons\" : [\"thumb_thumb_up\",\"thumb_thumb_down\"]},{\"id\": \"tick\", \"icons\" : [\"tick_tick\",\"tick_cross\"]},{\"id\": \"onoff\", \"icons\" : [\"onoff_clock\",\"onoff_clock_red\",\"onoff_add\",\"onoff_delete\"]},{\"id\": \"money\", \"icons\" : [\"money_money\",\"money_dollar\",\"money_euro\",\"money_pound\",\"money_yen\",\"money_coins\",\"money_ruby\"]},{\"id\": \"chart\", \"icons\" : [\"chart_bar\",\"chart_line\",\"chart_curve\",\"chart_pie\",\"chart_organisation\"]},]";
@Test
void checkImagesByFamily() throws IllegalAccessException {
List<MindmapIcon> iconByFamily = MindmapIcons.getIconByFamily(IconFamily.BULLET);
@ -27,21 +29,40 @@ public class IconsTest {
final List<MindmapIcon> iconByFamily = MindmapIcons.getIconByFamily(family);
for (MindmapIcon mindmapIcon : iconByFamily) {
final String pngName = mindmapIcon.getId() + ".png";
File file = new File("src/main/webapp/icons/", pngName);
if (!file.exists()) {
System.err.println("File not found:" + pngName);
}
// else {
// System.err.println("Found:" + pngName);
// }
final File file = new File("src/main/webapp/icons/", pngName);
Assert.assertTrue(file.exists(), "Could not be found:" + file.getAbsolutePath());
}
}
}
@Test
void jsonGenerationRepresentation() {
IconFamily[] values = IconFamily.values();
final StringBuilder result = new StringBuilder("[");
for (IconFamily family : values) {
result.append("{");
result.append("\"id\": \"" + family.name().toLowerCase() + "\"");
result.append(", \"icons\" : [");
final List<MindmapIcon> iconByFamily = MindmapIcons.getIconByFamily(family);
for (int i = 0; i < iconByFamily.size(); i++) {
if (i != 0) {
result.append(",");
}
MindmapIcon mindmapIcon = iconByFamily.get(i);
result.append("\"" + mindmapIcon.getId() + "\"");
}
result.append("]},");
}
result.append("]");
System.out.println(result.toString());
Assert.assertEquals(result.toString(), CURRENT_JSON_ICONS, "Some change has been introduced in the icons library. Please, check the IconIcons.js and update the variable.mindplot.ImageIcon.prototype.ICON_FAMILIES");
}
}