Fix image mappings issue during export/import to freemind.
This commit is contained in:
@@ -20,6 +20,7 @@ package com.wisemapping.exporter.freemind;
|
||||
|
||||
import com.wisemapping.exporter.ExportException;
|
||||
import com.wisemapping.exporter.Exporter;
|
||||
import com.wisemapping.importer.freemind.FreemindIconConverter;
|
||||
import com.wisemapping.model.MindMap;
|
||||
import com.wisemapping.util.JAXBUtils;
|
||||
import com.wisemapping.xml.freemind.*;
|
||||
@@ -174,10 +175,13 @@ public class FreemindExporter
|
||||
final List<Icon> iconsList = mindmapTopic.getIcon();
|
||||
for (Icon icon : iconsList) {
|
||||
final String id = icon.getId();
|
||||
com.wisemapping.xml.freemind.Icon freemindIcon = new com.wisemapping.xml.freemind.Icon();
|
||||
final String freemindIconId = FreemindIconMapper.getFreemindIcon(id);
|
||||
freemindIcon.setBUILTIN(freemindIconId);
|
||||
freemindNode.getArrowlinkOrCloudOrEdge().add(freemindIcon);
|
||||
final String freemindIconId = FreemindIconConverter.toFreemindId(id);
|
||||
if (freemindIconId != null) {
|
||||
|
||||
com.wisemapping.xml.freemind.Icon freemindIcon = new com.wisemapping.xml.freemind.Icon();
|
||||
freemindIcon.setBUILTIN(freemindIconId);
|
||||
freemindNode.getArrowlinkOrCloudOrEdge().add(freemindIcon);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.wisemapping.exporter.freemind;
|
||||
|
||||
import com.wisemapping.model.MindmapImagesFactory;
|
||||
import com.wisemapping.model.ImageFamily;
|
||||
import com.wisemapping.model.MindmapImage;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class FreemindIconMapper {
|
||||
|
||||
|
||||
private static Map<String,String> mindmapImageToFreemind = new HashMap<String,String>();
|
||||
private static final String DEFAULT_ICON = "button_ok";
|
||||
|
||||
public FreemindIconMapper()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static String getFreemindIcon(String mindmapImageId)
|
||||
{
|
||||
|
||||
String freemindIconId = mindmapImageToFreemind.get(mindmapImageId);
|
||||
|
||||
// The image doesn´t exists in freemind select he default image
|
||||
if (freemindIconId == null)
|
||||
{
|
||||
freemindIconId = DEFAULT_ICON;
|
||||
}
|
||||
return freemindIconId;
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
List<MindmapImage> images = MindmapImagesFactory.getImagesByFamily(ImageFamily.BULLET);
|
||||
|
||||
for (int idx=0; idx < images.size() ; idx++)
|
||||
{
|
||||
mindmapImageToFreemind.put(images.get(idx).getId(), "full-"+(idx+1));
|
||||
}
|
||||
|
||||
images = MindmapImagesFactory.getImagesByFamily(ImageFamily.FLAG);
|
||||
for (MindmapImage mindmapImage : images) {
|
||||
mindmapImageToFreemind.put(mindmapImage.getId(), "flag");
|
||||
}
|
||||
|
||||
images = MindmapImagesFactory.getImagesByFamily(ImageFamily.BULB);
|
||||
mindmapImageToFreemind.put(images.get(0).getId(), "idea");
|
||||
|
||||
images = MindmapImagesFactory.getImagesByFamily(ImageFamily.TICK);
|
||||
mindmapImageToFreemind.put(images.get(0).getId(), "button_ok");
|
||||
mindmapImageToFreemind.put(images.get(1).getId(), "button_cancel");
|
||||
|
||||
images = MindmapImagesFactory.getImagesByFamily(ImageFamily.ARROW);
|
||||
mindmapImageToFreemind.put(images.get(2).getId(), "back");
|
||||
mindmapImageToFreemind.put(images.get(3).getId(), "forward");
|
||||
|
||||
images = MindmapImagesFactory.getImagesByFamily(ImageFamily.FACE);
|
||||
mindmapImageToFreemind.put(images.get(3).getId(), "ksmiletris");
|
||||
|
||||
images = MindmapImagesFactory.getImagesByFamily(ImageFamily.FLAG);
|
||||
for (MindmapImage mindmapImage : images) {
|
||||
mindmapImageToFreemind.put(mindmapImage.getId(), "flag");
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.wisemapping.importer.freemind;
|
||||
|
||||
import com.wisemapping.model.MindmapIcon;
|
||||
import com.wisemapping.model.MindmapIcons;
|
||||
import com.wisemapping.model.IconFamily;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
final public class FreemindIconConverter {
|
||||
|
||||
|
||||
private final static Map<String, MindmapIcon> freeIdToIcon = new HashMap<String, MindmapIcon>();
|
||||
private final static Map<MindmapIcon, String> iconToFreeId = new HashMap<MindmapIcon, String>();
|
||||
|
||||
private static final MindmapIcon DEFAULT_ICON = MindmapIcons.getIconByFamily(IconFamily.BULLET).get(3);
|
||||
|
||||
private FreemindIconConverter() {
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String toWiseId(@NotNull String iconId) {
|
||||
final MindmapIcon result = freeIdToIcon.get(iconId);
|
||||
return result!=null?result.getId():null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String toFreemindId(@NotNull String iconId) {
|
||||
return iconToFreeId.get(MindmapIcons.findById(iconId));
|
||||
}
|
||||
|
||||
|
||||
static {
|
||||
|
||||
// Load bullets image mapping ...
|
||||
final List<MindmapIcon> bulletsImages = MindmapIcons.getIconByFamily(IconFamily.BULLET);
|
||||
for (int i = 0; i < bulletsImages.size(); i++) {
|
||||
final MindmapIcon icon = bulletsImages.get(i);
|
||||
iconToFreeId.put(icon, "full-" + i);
|
||||
}
|
||||
|
||||
final List<MindmapIcon> bulbImages = MindmapIcons.getIconByFamily(IconFamily.BULB);
|
||||
iconToFreeId.put(bulbImages.get(0), "idea");
|
||||
|
||||
final List<MindmapIcon> tickImages = MindmapIcons.getIconByFamily(IconFamily.TICK);
|
||||
iconToFreeId.put(tickImages.get(0), "button_ok");
|
||||
iconToFreeId.put(tickImages.get(1), "button_cancel");
|
||||
|
||||
// Map arrow icons ...
|
||||
iconToFreeId.put(MindmapIcons.ARROW_UP, "up");
|
||||
iconToFreeId.put(MindmapIcons.ARROW_DOWN, "down");
|
||||
iconToFreeId.put(MindmapIcons.ARROW_RIGHT, "back");
|
||||
iconToFreeId.put(MindmapIcons.ARROW_LEFT, "forward");
|
||||
|
||||
// Map smile icons ...
|
||||
iconToFreeId.put(MindmapIcons.FACE_PLAIN, "smiley-neutral");
|
||||
iconToFreeId.put(MindmapIcons.FACE_SMILE, "ksmiletris");
|
||||
iconToFreeId.put(MindmapIcons.FACE_SURPRISE, "smiley-oh");
|
||||
iconToFreeId.put(MindmapIcons.FACE_SAD, "smiley_bad");
|
||||
|
||||
|
||||
// Maps Flag familly Icons ...
|
||||
final List<MindmapIcon> flagImages = MindmapIcons.getIconByFamily(IconFamily.FLAG);
|
||||
for (MindmapIcon flagImage : flagImages) {
|
||||
iconToFreeId.put(flagImage, "flag-" + flagImage.getName());
|
||||
}
|
||||
|
||||
|
||||
final Set<MindmapIcon> mindmapIcons = iconToFreeId.keySet();
|
||||
for (MindmapIcon mindmapIcon : mindmapIcons) {
|
||||
freeIdToIcon.put(iconToFreeId.get(mindmapIcon), mindmapIcon);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.wisemapping.importer.freemind;
|
||||
|
||||
import com.wisemapping.model.MindmapImage;
|
||||
import com.wisemapping.model.MindmapImagesFactory;
|
||||
import com.wisemapping.model.ImageFamily;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class FreemindIconMapper {
|
||||
|
||||
|
||||
private static Map<String,String> freemindToMindmapIcon = new HashMap<String,String>();
|
||||
private static final MindmapImage DEFAULT_ICON = MindmapImagesFactory.getImagesByFamily(ImageFamily.BULLET).get(3);
|
||||
|
||||
public FreemindIconMapper()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static String getMindmapIcon(String freemindIconId)
|
||||
{
|
||||
|
||||
String iconId = freemindToMindmapIcon.get(freemindIconId);
|
||||
|
||||
// The image doesn´t exists in freemind select he default image
|
||||
if (iconId == null)
|
||||
{
|
||||
iconId = DEFAULT_ICON.getId();
|
||||
}
|
||||
return iconId;
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
List<MindmapImage> images = MindmapImagesFactory.getImagesByFamily(ImageFamily.BULLET);
|
||||
|
||||
freemindToMindmapIcon.put( "full-1",images.get(0).getId());
|
||||
freemindToMindmapIcon.put( "full-2",images.get(1).getId());
|
||||
freemindToMindmapIcon.put( "full-3",images.get(2).getId());
|
||||
freemindToMindmapIcon.put( "full-4",images.get(3).getId());
|
||||
freemindToMindmapIcon.put( "full-5",images.get(4).getId());
|
||||
freemindToMindmapIcon.put( "full-6",images.get(5).getId());
|
||||
freemindToMindmapIcon.put( "full-7",images.get(6).getId());
|
||||
|
||||
images = MindmapImagesFactory.getImagesByFamily(ImageFamily.BULB);
|
||||
freemindToMindmapIcon.put( "idea",images.get(0).getId());
|
||||
|
||||
images = MindmapImagesFactory.getImagesByFamily(ImageFamily.TICK);
|
||||
freemindToMindmapIcon.put( "button_ok",images.get(0).getId());
|
||||
freemindToMindmapIcon.put( "button_cancel",images.get(1).getId());
|
||||
|
||||
images = MindmapImagesFactory.getImagesByFamily(ImageFamily.ARROW);
|
||||
freemindToMindmapIcon.put( "back",images.get(2).getId());
|
||||
freemindToMindmapIcon.put( "forward",images.get(3).getId());
|
||||
|
||||
images = MindmapImagesFactory.getImagesByFamily(ImageFamily.FACE);
|
||||
freemindToMindmapIcon.put( "ksmiletris",images.get(3).getId());
|
||||
|
||||
images = MindmapImagesFactory.getImagesByFamily(ImageFamily.FLAG);
|
||||
|
||||
final MindmapImage orangeFlag = images.get(2);
|
||||
freemindToMindmapIcon.put("flag", orangeFlag.getId());
|
||||
}
|
||||
}
|
@@ -266,17 +266,22 @@ public class FreemindImporter
|
||||
currentTopic.setBrColor(edge.getCOLOR());
|
||||
} else if (freemindNode instanceof Icon) {
|
||||
final Icon freemindIcon = (Icon) freemindNode;
|
||||
final com.wisemapping.xml.mindmap.Icon mindmapIcon = new com.wisemapping.xml.mindmap.Icon();
|
||||
final String mindmapIconId = FreemindIconMapper.getMindmapIcon(freemindIcon.getBUILTIN());
|
||||
mindmapIcon.setId(mindmapIconId);
|
||||
currentTopic.getIcon().add(mindmapIcon);
|
||||
|
||||
String iconId = freemindIcon.getBUILTIN();
|
||||
final String wiseIconId = FreemindIconConverter.toWiseId(iconId);
|
||||
if (wiseIconId != null) {
|
||||
final com.wisemapping.xml.mindmap.Icon mindmapIcon = new com.wisemapping.xml.mindmap.Icon();
|
||||
mindmapIcon.setId(wiseIconId);
|
||||
currentTopic.getIcon().add(mindmapIcon);
|
||||
}
|
||||
|
||||
} else if (freemindNode instanceof Hook) {
|
||||
final Hook hook = (Hook) freemindNode;
|
||||
final com.wisemapping.xml.mindmap.Note mindmapNote = new com.wisemapping.xml.mindmap.Note();
|
||||
String textNote = hook.getText();
|
||||
if (textNote == null) // It is not a note is a BlinkingNodeHook or AutomaticLayout Hook
|
||||
{
|
||||
textNote = textNote != null ? textNote.replaceAll("\n", "%0A") : EMPTY_NOTE;
|
||||
textNote = EMPTY_NOTE;
|
||||
mindmapNote.setText(textNote);
|
||||
currentTopic.setNote(mindmapNote);
|
||||
}
|
||||
@@ -285,9 +290,9 @@ public class FreemindImporter
|
||||
final String type = content.getTYPE();
|
||||
|
||||
if (type.equals("NODE")) {
|
||||
final String text = getText(content);
|
||||
text.replaceAll("\n", "");
|
||||
text.trim();
|
||||
String text = getText(content);
|
||||
text = text.replaceAll("\n", "");
|
||||
text = text.trim();
|
||||
currentTopic.setText(text);
|
||||
} else {
|
||||
String text = getRichContent(content);
|
||||
|
@@ -18,12 +18,12 @@
|
||||
|
||||
package com.wisemapping.model;
|
||||
|
||||
public enum ImageFamily {
|
||||
public enum IconFamily {
|
||||
FLAG("FLAG","flag_"),
|
||||
BULLET("BULLET","bullet_"),
|
||||
TAG("TAG","tag_"),
|
||||
NUMBER("NUMBER","number_"),
|
||||
FACE("FACE","face_"),
|
||||
SMILEY("FACE","face_"),
|
||||
FACE_FUNY("FACEFUNY","facefuny_"),
|
||||
ARROW("ARROW","arrow_"),
|
||||
ARROWC("ARROWC","arrowc_"),
|
||||
@@ -39,7 +39,7 @@ public enum ImageFamily {
|
||||
private String prefix;
|
||||
private String name;
|
||||
|
||||
ImageFamily(String name, String prefix) {
|
||||
IconFamily(String name, String prefix) {
|
||||
this.name = name;
|
||||
this.prefix = prefix;
|
||||
}
|
@@ -18,12 +18,12 @@
|
||||
|
||||
package com.wisemapping.model;
|
||||
|
||||
public class MindmapImage
|
||||
public class MindmapIcon
|
||||
{
|
||||
private String name;
|
||||
private ImageFamily family;
|
||||
private IconFamily family;
|
||||
|
||||
public MindmapImage(String name, ImageFamily family)
|
||||
MindmapIcon(IconFamily family, String name)
|
||||
{
|
||||
this.name = name;
|
||||
this.family = family;
|
||||
@@ -34,7 +34,7 @@ public class MindmapImage
|
||||
return name;
|
||||
}
|
||||
|
||||
public ImageFamily getFamily()
|
||||
public IconFamily getFamily()
|
||||
{
|
||||
return family;
|
||||
}
|
226
wise-webapp/src/main/java/com/wisemapping/model/MindmapIcons.java
Executable file
226
wise-webapp/src/main/java/com/wisemapping/model/MindmapIcons.java
Executable file
@@ -0,0 +1,226 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.wisemapping.model;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class MindmapIcons {
|
||||
|
||||
private static Map<IconFamily, List<MindmapIcon>> images = new HashMap<IconFamily, List<MindmapIcon>>();
|
||||
|
||||
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 THUMB__UP = new MindmapIcon(IconFamily.THUMB, "thumb_up");
|
||||
public static final MindmapIcon THUMB_DOWN = new MindmapIcon(IconFamily.THUMB, "thumb_down");
|
||||
|
||||
public static final MindmapIcon ARROW_UP = new MindmapIcon(IconFamily.ARROW, "up");
|
||||
public static final MindmapIcon ARROW_DOWN = new MindmapIcon(IconFamily.ARROW, "down");
|
||||
public static final MindmapIcon ARROW_LEFT = new MindmapIcon(IconFamily.ARROW, "left");
|
||||
public static final MindmapIcon ARROW_RIGHT = new MindmapIcon(IconFamily.ARROW, "right");
|
||||
|
||||
static {
|
||||
images.put(IconFamily.BULLET, getImagesBullet());
|
||||
images.put(IconFamily.FLAG, getImagesFlag());
|
||||
images.put(IconFamily.NUMBER, getImagesNumber());
|
||||
images.put(IconFamily.TAG, getImagesTag());
|
||||
images.put(IconFamily.TASK, getImagesTask());
|
||||
images.put(IconFamily.SMILEY, getImagesFaces());
|
||||
images.put(IconFamily.BULB, getImagesBulb());
|
||||
images.put(IconFamily.ARROW, getImagesArrow());
|
||||
images.put(IconFamily.ARROWC, getImagesArrowC());
|
||||
images.put(IconFamily.CONN, getImagesConn());
|
||||
images.put(IconFamily.THUMB, getImagesThumbs());
|
||||
images.put(IconFamily.TICK, getImagesTick());
|
||||
images.put(IconFamily.ONOFF, getImagesOnOff());
|
||||
images.put(IconFamily.MONEY, getImagesMoney());
|
||||
images.put(IconFamily.CHART, getImagesChart());
|
||||
}
|
||||
|
||||
private static List<MindmapIcon> getImagesFaces() {
|
||||
final List<MindmapIcon> images = new ArrayList<MindmapIcon>();
|
||||
images.add(FACE_PLAIN);
|
||||
images.add(FACE_SAD);
|
||||
images.add(FACE_CRYING);
|
||||
images.add(FACE_SMILE);
|
||||
images.add(FACE_SURPRISE);
|
||||
images.add(FACE_WINK);
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapIcon> getImagesArrow() {
|
||||
final List<MindmapIcon> result = new ArrayList<MindmapIcon>();
|
||||
result.add(ARROW_UP);
|
||||
result.add(ARROW_DOWN);
|
||||
result.add(ARROW_LEFT);
|
||||
result.add(ARROW_RIGHT);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static List<MindmapIcon> getImagesArrowC() {
|
||||
final List<MindmapIcon> result = new ArrayList<MindmapIcon>();
|
||||
result.add(new MindmapIcon(IconFamily.ARROWC, "undo"));
|
||||
result.add(new MindmapIcon(IconFamily.ARROWC, "rotate_anticlockwise"));
|
||||
result.add(new MindmapIcon(IconFamily.ARROWC, "rotate_clockwise"));
|
||||
result.add(new MindmapIcon(IconFamily.ARROWC, "turn_left"));
|
||||
result.add(new MindmapIcon(IconFamily.ARROWC, "turn_right"));
|
||||
return result;
|
||||
}
|
||||
|
||||
private static List<MindmapIcon> getImagesBulb() {
|
||||
final List<MindmapIcon> images = new ArrayList<MindmapIcon>();
|
||||
images.add(new MindmapIcon(IconFamily.BULB, "light_on"));
|
||||
images.add(new MindmapIcon(IconFamily.BULB, "light_off"));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapIcon> getImagesTick() {
|
||||
final List<MindmapIcon> images = new ArrayList<MindmapIcon>();
|
||||
images.add(new MindmapIcon(IconFamily.TICK, "tick"));
|
||||
images.add(new MindmapIcon(IconFamily.TICK, "cross"));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapIcon> getImagesChart() {
|
||||
final List<MindmapIcon> images = new ArrayList<MindmapIcon>();
|
||||
images.add(new MindmapIcon(IconFamily.CHART, "bar"));
|
||||
images.add(new MindmapIcon(IconFamily.CHART, "line"));
|
||||
images.add(new MindmapIcon(IconFamily.CHART, "curve"));
|
||||
images.add(new MindmapIcon(IconFamily.CHART, "pie"));
|
||||
images.add(new MindmapIcon(IconFamily.CHART, "organisation"));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapIcon> getImagesOnOff() {
|
||||
final List<MindmapIcon> images = new ArrayList<MindmapIcon>();
|
||||
images.add(new MindmapIcon(IconFamily.ONOFF, "clock"));
|
||||
images.add(new MindmapIcon(IconFamily.ONOFF, "clock_red"));
|
||||
images.add(new MindmapIcon(IconFamily.ONOFF, "add"));
|
||||
images.add(new MindmapIcon(IconFamily.ONOFF, "delete"));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapIcon> getImagesMoney() {
|
||||
final List<MindmapIcon> images = new ArrayList<MindmapIcon>();
|
||||
images.add(new MindmapIcon(IconFamily.MONEY, "money"));
|
||||
images.add(new MindmapIcon(IconFamily.MONEY, "dollar"));
|
||||
images.add(new MindmapIcon(IconFamily.MONEY, "euro"));
|
||||
images.add(new MindmapIcon(IconFamily.MONEY, "pound"));
|
||||
images.add(new MindmapIcon(IconFamily.MONEY, "yen"));
|
||||
images.add(new MindmapIcon(IconFamily.MONEY, "coins"));
|
||||
images.add(new MindmapIcon(IconFamily.MONEY, "ruby"));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapIcon> getImagesThumbs() {
|
||||
final List<MindmapIcon> images = new ArrayList<MindmapIcon>();
|
||||
images.add(THUMB__UP);
|
||||
images.add(THUMB_DOWN);
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapIcon> getImagesConn() {
|
||||
final List<MindmapIcon> images = new ArrayList<MindmapIcon>();
|
||||
images.add(new MindmapIcon(IconFamily.CONN, "connect"));
|
||||
images.add(new MindmapIcon(IconFamily.CONN, "disconnect"));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapIcon> getImagesBullet() {
|
||||
final List<MindmapIcon> images = new ArrayList<MindmapIcon>();
|
||||
images.add(new MindmapIcon(IconFamily.BULLET, "black"));
|
||||
images.add(new MindmapIcon(IconFamily.BULLET, "blue"));
|
||||
images.add(new MindmapIcon(IconFamily.BULLET, "green"));
|
||||
images.add(new MindmapIcon(IconFamily.BULLET, "orange"));
|
||||
images.add(new MindmapIcon(IconFamily.BULLET, "red"));
|
||||
images.add(new MindmapIcon(IconFamily.BULLET, "pink"));
|
||||
images.add(new MindmapIcon(IconFamily.BULLET, "purple"));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapIcon> getImagesFlag() {
|
||||
final List<MindmapIcon> images = new ArrayList<MindmapIcon>();
|
||||
images.add(new MindmapIcon(IconFamily.FLAG, "blue"));
|
||||
images.add(new MindmapIcon(IconFamily.FLAG, "green"));
|
||||
images.add(new MindmapIcon(IconFamily.FLAG, "orange"));
|
||||
images.add(new MindmapIcon(IconFamily.FLAG, "pink"));
|
||||
images.add(new MindmapIcon(IconFamily.FLAG, "purple"));
|
||||
images.add(new MindmapIcon(IconFamily.FLAG, "yellow"));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapIcon> getImagesNumber() {
|
||||
final List<MindmapIcon> images = new ArrayList<MindmapIcon>();
|
||||
images.add(new MindmapIcon(IconFamily.NUMBER, "one"));
|
||||
images.add(new MindmapIcon(IconFamily.NUMBER, "two"));
|
||||
images.add(new MindmapIcon(IconFamily.NUMBER, "three"));
|
||||
images.add(new MindmapIcon(IconFamily.NUMBER, "four"));
|
||||
images.add(new MindmapIcon(IconFamily.NUMBER, "five"));
|
||||
images.add(new MindmapIcon(IconFamily.NUMBER, "six"));
|
||||
images.add(new MindmapIcon(IconFamily.NUMBER, "seven"));
|
||||
images.add(new MindmapIcon(IconFamily.NUMBER, "eight"));
|
||||
images.add(new MindmapIcon(IconFamily.NUMBER, "nine"));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapIcon> getImagesTag() {
|
||||
final List<MindmapIcon> images = new ArrayList<MindmapIcon>();
|
||||
images.add(new MindmapIcon(IconFamily.TAG, "blue"));
|
||||
images.add(new MindmapIcon(IconFamily.TAG, "green"));
|
||||
images.add(new MindmapIcon(IconFamily.TAG, "orange"));
|
||||
images.add(new MindmapIcon(IconFamily.TAG, "red"));
|
||||
images.add(new MindmapIcon(IconFamily.TAG, "pink"));
|
||||
images.add(new MindmapIcon(IconFamily.TAG, "yellow"));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapIcon> getImagesTask() {
|
||||
final List<MindmapIcon> images = new ArrayList<MindmapIcon>();
|
||||
images.add(new MindmapIcon(IconFamily.TASK, "one"));
|
||||
images.add(new MindmapIcon(IconFamily.TASK, "two"));
|
||||
images.add(new MindmapIcon(IconFamily.TASK, "three"));
|
||||
images.add(new MindmapIcon(IconFamily.TASK, "four"));
|
||||
images.add(new MindmapIcon(IconFamily.TASK, "five"));
|
||||
return images;
|
||||
}
|
||||
|
||||
|
||||
public static List<MindmapIcon> getIconByFamily(IconFamily family) {
|
||||
return images.get(family);
|
||||
}
|
||||
|
||||
public static MindmapIcon findById(final @NotNull String id) {
|
||||
for (IconFamily imageFamily : images.keySet()) {
|
||||
final List<MindmapIcon> mindmapIcons = images.get(imageFamily);
|
||||
for (MindmapIcon mindmapIcon : mindmapIcons) {
|
||||
if (mindmapIcon.getId().equals(id)) {
|
||||
return mindmapIcon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Image could not be found. Id:" + id);
|
||||
}
|
||||
}
|
@@ -1,216 +0,0 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.wisemapping.model;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class MindmapImagesFactory {
|
||||
|
||||
private static Map<ImageFamily,List<MindmapImage>> images = new HashMap<ImageFamily,List<MindmapImage>>();
|
||||
|
||||
static {
|
||||
images.put(ImageFamily.BULLET, getImagesBullet());
|
||||
images.put(ImageFamily.FLAG,getImagesFlag());
|
||||
images.put(ImageFamily.NUMBER,getImagesNumber());
|
||||
images.put(ImageFamily.TAG,getImagesTag());
|
||||
images.put(ImageFamily.TASK,getImagesTask());
|
||||
images.put(ImageFamily.FACE,getImagesFaces());
|
||||
images.put(ImageFamily.BULB,getImagesBulb());
|
||||
images.put(ImageFamily.ARROW,getImagesArrow());
|
||||
images.put(ImageFamily.ARROWC,getImagesArrowC());
|
||||
images.put(ImageFamily.CONN,getImagesConn());
|
||||
images.put(ImageFamily.THUMB,getImagesThumbs());
|
||||
images.put(ImageFamily.TICK,getImagesTick());
|
||||
images.put(ImageFamily.ONOFF,getImagesOnOff());
|
||||
images.put(ImageFamily.MONEY,getImagesMoney());
|
||||
images.put(ImageFamily.CHART,getImagesChart());
|
||||
}
|
||||
|
||||
private static List<MindmapImage> getImagesFaces()
|
||||
{
|
||||
final List<MindmapImage> images = new ArrayList<MindmapImage>();
|
||||
images.add(new MindmapImage("plain",ImageFamily.FACE));
|
||||
images.add(new MindmapImage("sad",ImageFamily.FACE));
|
||||
images.add(new MindmapImage("crying",ImageFamily.FACE));
|
||||
images.add(new MindmapImage("smile",ImageFamily.FACE));
|
||||
images.add(new MindmapImage("surprise",ImageFamily.FACE));
|
||||
images.add(new MindmapImage("wink",ImageFamily.FACE));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapImage> getImagesArrow()
|
||||
{
|
||||
final List<MindmapImage> images = new ArrayList<MindmapImage>();
|
||||
images.add(new MindmapImage("up",ImageFamily.ARROW));
|
||||
images.add(new MindmapImage("down",ImageFamily.ARROW));
|
||||
images.add(new MindmapImage("left",ImageFamily.ARROW));
|
||||
images.add(new MindmapImage("right",ImageFamily.ARROW));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapImage> getImagesArrowC()
|
||||
{
|
||||
final List<MindmapImage> images = new ArrayList<MindmapImage>();
|
||||
images.add(new MindmapImage("undo",ImageFamily.ARROWC));
|
||||
images.add(new MindmapImage("rotate_anticlockwise",ImageFamily.ARROWC));
|
||||
images.add(new MindmapImage("rotate_clockwise",ImageFamily.ARROWC));
|
||||
images.add(new MindmapImage("turn_left",ImageFamily.ARROWC));
|
||||
images.add(new MindmapImage("turn_right",ImageFamily.ARROWC));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapImage> getImagesBulb()
|
||||
{
|
||||
final List<MindmapImage> images = new ArrayList<MindmapImage>();
|
||||
images.add(new MindmapImage("light_on",ImageFamily.BULB));
|
||||
images.add(new MindmapImage("light_off",ImageFamily.BULB));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapImage> getImagesTick()
|
||||
{
|
||||
final List<MindmapImage> images = new ArrayList<MindmapImage>();
|
||||
images.add(new MindmapImage("tick",ImageFamily.TICK));
|
||||
images.add(new MindmapImage("cross",ImageFamily.TICK));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapImage> getImagesChart()
|
||||
{
|
||||
final List<MindmapImage> images = new ArrayList<MindmapImage>();
|
||||
images.add(new MindmapImage("bar",ImageFamily.CHART));
|
||||
images.add(new MindmapImage("line",ImageFamily.CHART));
|
||||
images.add(new MindmapImage("curve",ImageFamily.CHART));
|
||||
images.add(new MindmapImage("pie",ImageFamily.CHART));
|
||||
images.add(new MindmapImage("organisation",ImageFamily.CHART));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapImage> getImagesOnOff()
|
||||
{
|
||||
final List<MindmapImage> images = new ArrayList<MindmapImage>();
|
||||
images.add(new MindmapImage("clock",ImageFamily.ONOFF));
|
||||
images.add(new MindmapImage("clock_red",ImageFamily.ONOFF));
|
||||
images.add(new MindmapImage("add",ImageFamily.ONOFF));
|
||||
images.add(new MindmapImage("delete",ImageFamily.ONOFF));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapImage> getImagesMoney()
|
||||
{
|
||||
final List<MindmapImage> images = new ArrayList<MindmapImage>();
|
||||
images.add(new MindmapImage("money",ImageFamily.MONEY));
|
||||
images.add(new MindmapImage("dollar",ImageFamily.MONEY));
|
||||
images.add(new MindmapImage("euro",ImageFamily.MONEY));
|
||||
images.add(new MindmapImage("pound",ImageFamily.MONEY));
|
||||
images.add(new MindmapImage("yen",ImageFamily.MONEY));
|
||||
images.add(new MindmapImage("coins",ImageFamily.MONEY));
|
||||
images.add(new MindmapImage("ruby",ImageFamily.MONEY));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapImage> getImagesThumbs()
|
||||
{
|
||||
final List<MindmapImage> images = new ArrayList<MindmapImage>();
|
||||
images.add(new MindmapImage("thumb_up",ImageFamily.THUMB));
|
||||
images.add(new MindmapImage("thumb_down",ImageFamily.THUMB));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapImage> getImagesConn()
|
||||
{
|
||||
final List<MindmapImage> images = new ArrayList<MindmapImage>();
|
||||
images.add(new MindmapImage("connect",ImageFamily.CONN));
|
||||
images.add(new MindmapImage("disconnect",ImageFamily.CONN));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapImage> getImagesBullet()
|
||||
{
|
||||
final List<MindmapImage> images = new ArrayList<MindmapImage>();
|
||||
images.add(new MindmapImage("black",ImageFamily.BULLET));
|
||||
images.add(new MindmapImage("blue",ImageFamily.BULLET));
|
||||
images.add(new MindmapImage("green",ImageFamily.BULLET));
|
||||
images.add(new MindmapImage("orange",ImageFamily.BULLET));
|
||||
images.add(new MindmapImage("red",ImageFamily.BULLET));
|
||||
images.add(new MindmapImage("pink",ImageFamily.BULLET));
|
||||
images.add(new MindmapImage("purple",ImageFamily.BULLET));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapImage> getImagesFlag()
|
||||
{
|
||||
final List<MindmapImage> images = new ArrayList<MindmapImage>();
|
||||
images.add(new MindmapImage("blue",ImageFamily.FLAG));
|
||||
images.add(new MindmapImage("green",ImageFamily.FLAG));
|
||||
images.add(new MindmapImage("orange",ImageFamily.FLAG));
|
||||
images.add(new MindmapImage("pink",ImageFamily.FLAG));
|
||||
images.add(new MindmapImage("purple",ImageFamily.FLAG));
|
||||
images.add(new MindmapImage("yellow",ImageFamily.FLAG));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapImage> getImagesNumber()
|
||||
{
|
||||
final List<MindmapImage> images = new ArrayList<MindmapImage>();
|
||||
images.add(new MindmapImage("one",ImageFamily.NUMBER));
|
||||
images.add(new MindmapImage("two",ImageFamily.NUMBER));
|
||||
images.add(new MindmapImage("three",ImageFamily.NUMBER));
|
||||
images.add(new MindmapImage("four",ImageFamily.NUMBER));
|
||||
images.add(new MindmapImage("five",ImageFamily.NUMBER));
|
||||
images.add(new MindmapImage("six",ImageFamily.NUMBER));
|
||||
images.add(new MindmapImage("seven",ImageFamily.NUMBER));
|
||||
images.add(new MindmapImage("eight",ImageFamily.NUMBER));
|
||||
images.add(new MindmapImage("nine",ImageFamily.NUMBER));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapImage> getImagesTag()
|
||||
{
|
||||
final List<MindmapImage> images = new ArrayList<MindmapImage>();
|
||||
images.add(new MindmapImage("blue",ImageFamily.TAG));
|
||||
images.add(new MindmapImage("green",ImageFamily.TAG));
|
||||
images.add(new MindmapImage("orange",ImageFamily.TAG));
|
||||
images.add(new MindmapImage("red",ImageFamily.TAG));
|
||||
images.add(new MindmapImage("pink",ImageFamily.TAG));
|
||||
images.add(new MindmapImage("yellow",ImageFamily.TAG));
|
||||
return images;
|
||||
}
|
||||
|
||||
private static List<MindmapImage> getImagesTask()
|
||||
{
|
||||
final List<MindmapImage> images = new ArrayList<MindmapImage>();
|
||||
images.add(new MindmapImage("one",ImageFamily.TASK));
|
||||
images.add(new MindmapImage("two",ImageFamily.TASK));
|
||||
images.add(new MindmapImage("three",ImageFamily.TASK));
|
||||
images.add(new MindmapImage("four",ImageFamily.TASK));
|
||||
images.add(new MindmapImage("five",ImageFamily.TASK));
|
||||
return images;
|
||||
}
|
||||
|
||||
public static Collection<List<MindmapImage>> getAllImages()
|
||||
{
|
||||
return images.values();
|
||||
}
|
||||
|
||||
public static List<MindmapImage> getImagesByFamily(ImageFamily family)
|
||||
{
|
||||
return images.get(family);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user