mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 06:07:57 +01:00
- Freemind export store order and position using extended properties.
- Fix order calculation algorith during import. - Optimize JABX context initialization.
This commit is contained in:
parent
ae071f7fcb
commit
dd072ed958
@ -18,13 +18,11 @@
|
|||||||
|
|
||||||
package com.wisemapping.exporter;
|
package com.wisemapping.exporter;
|
||||||
|
|
||||||
import com.wisemapping.exporter.ExportException;
|
|
||||||
import com.wisemapping.exporter.Exporter;
|
|
||||||
import com.wisemapping.importer.freemind.FreemindIconConverter;
|
import com.wisemapping.importer.freemind.FreemindIconConverter;
|
||||||
import com.wisemapping.model.MindMap;
|
import com.wisemapping.model.MindMap;
|
||||||
import com.wisemapping.model.ShapeStyle;
|
import com.wisemapping.model.ShapeStyle;
|
||||||
import com.wisemapping.util.JAXBUtils;
|
import com.wisemapping.util.JAXBUtils;
|
||||||
import com.wisemapping.xml.Style;
|
|
||||||
import com.wisemapping.xml.freemind.*;
|
import com.wisemapping.xml.freemind.*;
|
||||||
import com.wisemapping.xml.mindmap.RelationshipType;
|
import com.wisemapping.xml.mindmap.RelationshipType;
|
||||||
import com.wisemapping.xml.mindmap.TopicType;
|
import com.wisemapping.xml.mindmap.TopicType;
|
||||||
@ -140,7 +138,7 @@ public class FreemindExporter
|
|||||||
|
|
||||||
final String shape = mindmapTopic.getShape();
|
final String shape = mindmapTopic.getShape();
|
||||||
if (shape != null && !shape.isEmpty()) {
|
if (shape != null && !shape.isEmpty()) {
|
||||||
if ( isRoot && !ShapeStyle.ROUNDED_RETAGLE.getStyle().endsWith(shape) || !isRoot && !ShapeStyle.LINE.getStyle().endsWith(shape) ) {
|
if (isRoot && !ShapeStyle.ROUNDED_RETAGLE.getStyle().endsWith(shape) || !isRoot && !ShapeStyle.LINE.getStyle().endsWith(shape)) {
|
||||||
|
|
||||||
String style = shape;
|
String style = shape;
|
||||||
if (ShapeStyle.ROUNDED_RETAGLE.getStyle().equals(shape)) {
|
if (ShapeStyle.ROUNDED_RETAGLE.getStyle().equals(shape)) {
|
||||||
@ -156,6 +154,16 @@ public class FreemindExporter
|
|||||||
addEdgeNode(freemindNode, mindmapTopic);
|
addEdgeNode(freemindNode, mindmapTopic);
|
||||||
addNote(freemindNode, mindmapTopic);
|
addNote(freemindNode, mindmapTopic);
|
||||||
|
|
||||||
|
final String position = mindmapTopic.getPosition();
|
||||||
|
if (position != null && !position.isEmpty()) {
|
||||||
|
freemindNode.setWcoords(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
final Integer order = mindmapTopic.getOrder();
|
||||||
|
if (order != null) {
|
||||||
|
freemindNode.setWorder(BigInteger.valueOf(order));
|
||||||
|
}
|
||||||
|
|
||||||
Boolean shrink = mindmapTopic.isShrink();
|
Boolean shrink = mindmapTopic.isShrink();
|
||||||
if (shrink != null && shrink)
|
if (shrink != null && shrink)
|
||||||
freemindNode.setFOLDED(String.valueOf(shrink));
|
freemindNode.setFOLDED(String.valueOf(shrink));
|
||||||
|
@ -20,6 +20,7 @@ package com.wisemapping.importer;
|
|||||||
|
|
||||||
import com.wisemapping.model.MindMap;
|
import com.wisemapping.model.MindMap;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
public interface Importer
|
public interface Importer
|
||||||
|
@ -45,6 +45,8 @@ import java.math.BigInteger;
|
|||||||
public class FreemindImporter
|
public class FreemindImporter
|
||||||
implements Importer {
|
implements Importer {
|
||||||
|
|
||||||
|
public static final String CODE_VERSION = "pela";
|
||||||
|
public static final int HALF_ROOT_TOPICS_SEPARATION = 25;
|
||||||
private com.wisemapping.xml.mindmap.ObjectFactory mindmapObjectFactory;
|
private com.wisemapping.xml.mindmap.ObjectFactory mindmapObjectFactory;
|
||||||
private static final String POSITION_LEFT = "left";
|
private static final String POSITION_LEFT = "left";
|
||||||
private static final String BOLD = "bold";
|
private static final String BOLD = "bold";
|
||||||
@ -53,45 +55,80 @@ public class FreemindImporter
|
|||||||
private java.util.Map<String, TopicType> nodesMap = null;
|
private java.util.Map<String, TopicType> nodesMap = null;
|
||||||
private List<RelationshipType> relationships = null;
|
private List<RelationshipType> relationships = null;
|
||||||
private static final String EMPTY_FONT_STYLE = ";;;;;";
|
private static final String EMPTY_FONT_STYLE = ";;;;;";
|
||||||
|
private final static Charset UTF_8_CHARSET = Charset.forName("UTF-8");
|
||||||
|
private final static int ORDER_SEPARATION_FACTOR = 2;
|
||||||
|
|
||||||
private int currentId;
|
private int currentId;
|
||||||
|
|
||||||
|
public static void main(String argv[]) {
|
||||||
|
|
||||||
|
|
||||||
|
// Now, calculate the order it belongs to ...
|
||||||
|
// 3 = -100 0
|
||||||
|
// 1 = -50 1
|
||||||
|
// 0 = 0 2
|
||||||
|
// 2 = 50 3
|
||||||
|
// 4 = 100 4
|
||||||
|
|
||||||
|
int total = 2;
|
||||||
|
int center = (total - 1) / 2;
|
||||||
|
|
||||||
|
|
||||||
|
for (int i = 0; i < total; i++) {
|
||||||
|
|
||||||
|
int result = i - center + ((total % 2 == 0) ? 0 : 1);
|
||||||
|
if (result > 0) {
|
||||||
|
result = (result - 1) * 2;
|
||||||
|
} else {
|
||||||
|
result = (result * -2) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println(i + "->" + result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public MindMap importMap(String mapName, String description, InputStream input) throws ImporterException {
|
public MindMap importMap(String mapName, String description, InputStream input) throws ImporterException {
|
||||||
|
|
||||||
final MindMap map;
|
final MindMap result = new MindMap();
|
||||||
|
nodesMap = new HashMap<String, TopicType>();
|
||||||
|
relationships = new ArrayList<RelationshipType>();
|
||||||
mindmapObjectFactory = new com.wisemapping.xml.mindmap.ObjectFactory();
|
mindmapObjectFactory = new com.wisemapping.xml.mindmap.ObjectFactory();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
String wiseXml;
|
||||||
final Map freemindMap = (Map) JAXBUtils.getMapObject(input, "com.wisemapping.xml.freemind");
|
final Map freemindMap = (Map) JAXBUtils.getMapObject(input, "com.wisemapping.xml.freemind");
|
||||||
|
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
|
|
||||||
final com.wisemapping.xml.mindmap.Map mindmapMap = mindmapObjectFactory.createMap();
|
final com.wisemapping.xml.mindmap.Map mindmapMap = mindmapObjectFactory.createMap();
|
||||||
mindmapMap.setVersion("pela");
|
mindmapMap.setVersion(CODE_VERSION);
|
||||||
currentId = 0;
|
currentId = 0;
|
||||||
|
|
||||||
final Node centralNode = freemindMap.getNode();
|
final Node freeNode = freemindMap.getNode();
|
||||||
final TopicType centralTopic = mindmapObjectFactory.createTopicType();
|
final TopicType wiseTopic = mindmapObjectFactory.createTopicType();
|
||||||
centralTopic.setId(String.valueOf(currentId++));
|
wiseTopic.setId(String.valueOf(currentId++));
|
||||||
centralTopic.setCentral(true);
|
wiseTopic.setCentral(true);
|
||||||
|
|
||||||
setNodePropertiesToTopic(centralTopic, centralNode);
|
convertNodeProperties(freeNode, wiseTopic);
|
||||||
centralTopic.setShape(ShapeStyle.ROUNDED_RETAGLE.getStyle());
|
|
||||||
mindmapMap.getTopic().add(centralTopic);
|
wiseTopic.setShape(ShapeStyle.ROUNDED_RETAGLE.getStyle());
|
||||||
|
mindmapMap.getTopic().add(wiseTopic);
|
||||||
mindmapMap.setName(mapName);
|
mindmapMap.setName(mapName);
|
||||||
|
|
||||||
nodesMap = new HashMap<String, TopicType>();
|
nodesMap.put(freeNode.getID(), wiseTopic);
|
||||||
relationships = new ArrayList<RelationshipType>();
|
|
||||||
nodesMap.put(centralNode.getID(), centralTopic);
|
convertChildNodes(freeNode, wiseTopic, 1);
|
||||||
addTopicFromNode(centralNode, centralTopic);
|
|
||||||
fixCentralTopicChildOrder(centralTopic);
|
|
||||||
|
|
||||||
addRelationships(mindmapMap);
|
addRelationships(mindmapMap);
|
||||||
|
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
JAXBUtils.saveMap(mindmapMap, baos, "com.wisemapping.xml.mindmap");
|
||||||
JAXBUtils.saveMap(mindmapMap, out, "com.wisemapping.xml.mindmap");
|
|
||||||
|
|
||||||
map = new MindMap();
|
wiseXml = new String(baos.toByteArray(), UTF_8_CHARSET);
|
||||||
map.setNativeXml(new String(out.toByteArray(), Charset.forName("UTF-8")));
|
|
||||||
map.setTitle(mapName);
|
|
||||||
map.setDescription(description);
|
result.setNativeXml(wiseXml);
|
||||||
|
result.setTitle(mapName);
|
||||||
|
result.setDescription(description);
|
||||||
|
|
||||||
} catch (JAXBException e) {
|
} catch (JAXBException e) {
|
||||||
throw new ImporterException(e);
|
throw new ImporterException(e);
|
||||||
@ -99,7 +136,7 @@ public class FreemindImporter
|
|||||||
throw new ImporterException(e);
|
throw new ImporterException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return map;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addRelationships(@NotNull com.wisemapping.xml.mindmap.Map mindmapMap) {
|
private void addRelationships(@NotNull com.wisemapping.xml.mindmap.Map mindmapMap) {
|
||||||
@ -122,7 +159,7 @@ public class FreemindImporter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fixRelationshipControlPoints(RelationshipType relationship) {
|
private void fixRelationshipControlPoints(@NotNull RelationshipType relationship) {
|
||||||
//Both relationship node's ids should be freemind ones at this point.
|
//Both relationship node's ids should be freemind ones at this point.
|
||||||
TopicType srcTopic = nodesMap.get(relationship.getSrcTopicId());
|
TopicType srcTopic = nodesMap.get(relationship.getSrcTopicId());
|
||||||
TopicType destTopicType = nodesMap.get(relationship.getDestTopicId());
|
TopicType destTopicType = nodesMap.get(relationship.getDestTopicId());
|
||||||
@ -139,7 +176,7 @@ public class FreemindImporter
|
|||||||
relationship.setDestCtrlPoint(x + "," + destCtrlPoint[1]);
|
relationship.setDestCtrlPoint(x + "," + destCtrlPoint[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Fix y coord
|
//Fix coord
|
||||||
if (srcTopic.getOrder() % 2 != 0) { //Odd order.
|
if (srcTopic.getOrder() % 2 != 0) { //Odd order.
|
||||||
String[] srcCtrlPoint = relationship.getSrcCtrlPoint().split(",");
|
String[] srcCtrlPoint = relationship.getSrcCtrlPoint().split(",");
|
||||||
int y = Integer.valueOf(srcCtrlPoint[1]) * -1;
|
int y = Integer.valueOf(srcCtrlPoint[1]) * -1;
|
||||||
@ -153,168 +190,110 @@ public class FreemindImporter
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fixCentralTopicChildOrder(@NotNull TopicType centralTopic) {
|
|
||||||
List<TopicType> topics = centralTopic.getTopic();
|
|
||||||
List<TopicType> leftTopics = new ArrayList<TopicType>();
|
|
||||||
List<TopicType> rightTopics = new ArrayList<TopicType>();
|
|
||||||
|
|
||||||
for (TopicType topic : topics) {
|
|
||||||
if (isOnLeftSide(topic)) {
|
|
||||||
leftTopics.add(topic);
|
|
||||||
} else {
|
|
||||||
rightTopics.add(topic);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (leftTopics.size() > 0) {
|
|
||||||
int size = leftTopics.size();
|
|
||||||
int index = 0;
|
|
||||||
int center = size / 2;
|
|
||||||
if (size % 2 == 0) { //Even number, then place middle point in 1 index
|
|
||||||
index = 1;
|
|
||||||
center--;
|
|
||||||
}
|
|
||||||
int index2 = index;
|
|
||||||
|
|
||||||
leftTopics.get(center).setOrder(index);
|
|
||||||
for (int i = center - 1; i >= 0; i--) {
|
|
||||||
if (index == 0) {
|
|
||||||
index++;
|
|
||||||
} else {
|
|
||||||
index += 2;
|
|
||||||
}
|
|
||||||
leftTopics.get(i).setOrder(index);
|
|
||||||
}
|
|
||||||
index = index2;
|
|
||||||
for (int i = center + 1; i < size; i++) {
|
|
||||||
if (index == 1) {
|
|
||||||
index++;
|
|
||||||
} else {
|
|
||||||
index += 2;
|
|
||||||
}
|
|
||||||
leftTopics.get(i).setOrder(index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (rightTopics.size() > 0) {
|
|
||||||
int size = rightTopics.size();
|
|
||||||
int index = 0;
|
|
||||||
int center = size / 2;
|
|
||||||
if (size % 2 == 0) { //Even number, then place middle point in 1 index
|
|
||||||
index = 1;
|
|
||||||
center--;
|
|
||||||
}
|
|
||||||
int index2 = index;
|
|
||||||
rightTopics.get(center).setOrder(index);
|
|
||||||
for (int i = center - 1; i >= 0; i--) {
|
|
||||||
if (index == 0) {
|
|
||||||
index++;
|
|
||||||
} else {
|
|
||||||
index += 2;
|
|
||||||
}
|
|
||||||
rightTopics.get(i).setOrder(index);
|
|
||||||
}
|
|
||||||
index = index2;
|
|
||||||
for (int i = center + 1; i < size; i++) {
|
|
||||||
if (index == 1) {
|
|
||||||
index++;
|
|
||||||
} else {
|
|
||||||
index += 2;
|
|
||||||
}
|
|
||||||
rightTopics.get(i).setOrder(index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isOnLeftSide(TopicType topic) {
|
private boolean isOnLeftSide(TopicType topic) {
|
||||||
String[] position = topic.getPosition().split(",");
|
String[] position = topic.getPosition().split(",");
|
||||||
int x = Integer.parseInt(position[0]);
|
int x = Integer.parseInt(position[0]);
|
||||||
return x < 0;
|
return x < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addTopicFromNode(@NotNull Node mainNode, @NotNull TopicType topic) {
|
private boolean isOnLeftSide(@NotNull String pos) {
|
||||||
final List<Object> freemindNodes = mainNode.getArrowlinkOrCloudOrEdge();
|
String[] position = pos.split(",");
|
||||||
TopicType currentTopic = topic;
|
int x = Integer.parseInt(position[0]);
|
||||||
|
return x < 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void convertChildNodes(@NotNull Node freeParent, @NotNull TopicType wiseParent, final int depth) {
|
||||||
|
final List<Object> freeChilden = freeParent.getArrowlinkOrCloudOrEdge();
|
||||||
|
TopicType currentWiseTopic = wiseParent;
|
||||||
|
|
||||||
int order = 0;
|
int order = 0;
|
||||||
for (Object freemindNode : freemindNodes) {
|
for (Object element : freeChilden) {
|
||||||
|
|
||||||
if (freemindNode instanceof Node) {
|
if (element instanceof Node) {
|
||||||
final Node node = (Node) freemindNode;
|
final Node freeChild = (Node) element;
|
||||||
TopicType newTopic = mindmapObjectFactory.createTopicType();
|
final TopicType wiseChild = mindmapObjectFactory.createTopicType();
|
||||||
newTopic.setId(String.valueOf(currentId++));
|
|
||||||
nodesMap.put(node.getID(), newTopic); //Lets use freemind id temporarily. This will be fixed when adding relationship to the map.
|
|
||||||
newTopic.setOrder(order++);
|
|
||||||
|
|
||||||
// Is there any link ?
|
// Set an incremental id ...
|
||||||
final String url = node.getLINK();
|
wiseChild.setId(String.valueOf(currentId++));
|
||||||
if (url != null) {
|
|
||||||
final Link link = new Link();
|
// Lets use freemind id temporarily. This will be fixed when adding relationship to the map.
|
||||||
link.setUrl(url);
|
nodesMap.put(freeChild.getID(), wiseChild);
|
||||||
newTopic.setLink(link);
|
|
||||||
|
// Set node order ...
|
||||||
|
int norder;
|
||||||
|
if (depth != 1) {
|
||||||
|
norder = order++;
|
||||||
|
} else {
|
||||||
|
norder = calcFirstLevelOrder(freeChilden, freeChild);
|
||||||
}
|
}
|
||||||
|
wiseChild.setOrder(norder);
|
||||||
|
|
||||||
if (POSITION_LEFT.equals(mainNode.getPOSITION())) {
|
// Convert node position ...
|
||||||
node.setPOSITION(POSITION_LEFT);
|
final String position = convertPosition(wiseParent, freeChild, depth, norder);
|
||||||
|
wiseChild.setPosition(position);
|
||||||
|
|
||||||
|
// Convert the rest of the node properties ...
|
||||||
|
convertNodeProperties(freeChild, wiseChild);
|
||||||
|
|
||||||
|
convertChildNodes(freeChild, wiseChild, depth + 1);
|
||||||
|
|
||||||
|
if (!wiseChild.equals(wiseParent)) {
|
||||||
|
wiseParent.getTopic().add(wiseChild);
|
||||||
}
|
}
|
||||||
|
currentWiseTopic = wiseChild;
|
||||||
|
|
||||||
setNodePropertiesToTopic(newTopic, node);
|
} else if (element instanceof Font) {
|
||||||
addTopicFromNode(node, newTopic);
|
final Font font = (Font) element;
|
||||||
if (!newTopic.equals(topic)) {
|
final String fontStyle = generateFontStyle(freeParent, font);
|
||||||
topic.getTopic().add(newTopic);
|
|
||||||
}
|
|
||||||
currentTopic = newTopic;
|
|
||||||
|
|
||||||
} else if (freemindNode instanceof Font) {
|
|
||||||
final Font font = (Font) freemindNode;
|
|
||||||
final String fontStyle = generateFontStyle(mainNode, font);
|
|
||||||
if (fontStyle != null) {
|
if (fontStyle != null) {
|
||||||
currentTopic.setFontStyle(fontStyle);
|
currentWiseTopic.setFontStyle(fontStyle);
|
||||||
}
|
}
|
||||||
} else if (freemindNode instanceof Edge) {
|
} else if (element instanceof Edge) {
|
||||||
final Edge edge = (Edge) freemindNode;
|
final Edge edge = (Edge) element;
|
||||||
currentTopic.setBrColor(edge.getCOLOR());
|
currentWiseTopic.setBrColor(edge.getCOLOR());
|
||||||
} else if (freemindNode instanceof Icon) {
|
} else if (element instanceof Icon) {
|
||||||
final Icon freemindIcon = (Icon) freemindNode;
|
final Icon freemindIcon = (Icon) element;
|
||||||
|
|
||||||
String iconId = freemindIcon.getBUILTIN();
|
String iconId = freemindIcon.getBUILTIN();
|
||||||
final String wiseIconId = FreemindIconConverter.toWiseId(iconId);
|
final String wiseIconId = FreemindIconConverter.toWiseId(iconId);
|
||||||
if (wiseIconId != null) {
|
if (wiseIconId != null) {
|
||||||
final com.wisemapping.xml.mindmap.Icon mindmapIcon = new com.wisemapping.xml.mindmap.Icon();
|
final com.wisemapping.xml.mindmap.Icon mindmapIcon = new com.wisemapping.xml.mindmap.Icon();
|
||||||
mindmapIcon.setId(wiseIconId);
|
mindmapIcon.setId(wiseIconId);
|
||||||
currentTopic.getIcon().add(mindmapIcon);
|
currentWiseTopic.getIcon().add(mindmapIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (freemindNode instanceof Hook) {
|
} else if (element instanceof Hook) {
|
||||||
final Hook hook = (Hook) freemindNode;
|
final Hook hook = (Hook) element;
|
||||||
final com.wisemapping.xml.mindmap.Note mindmapNote = new com.wisemapping.xml.mindmap.Note();
|
final com.wisemapping.xml.mindmap.Note mindmapNote = new com.wisemapping.xml.mindmap.Note();
|
||||||
String textNote = hook.getText();
|
String textNote = hook.getText();
|
||||||
if (textNote == null) // It is not a note is a BlinkingNodeHook or AutomaticLayout Hook
|
if (textNote == null) // It is not a note is a BlinkingNodeHook or AutomaticLayout Hook
|
||||||
{
|
{
|
||||||
textNote = EMPTY_NOTE;
|
textNote = EMPTY_NOTE;
|
||||||
mindmapNote.setText(textNote);
|
mindmapNote.setText(textNote);
|
||||||
currentTopic.setNote(mindmapNote);
|
currentWiseTopic.setNote(mindmapNote);
|
||||||
}
|
}
|
||||||
} else if (freemindNode instanceof Richcontent) {
|
} else if (element instanceof Richcontent) {
|
||||||
final Richcontent content = (Richcontent) freemindNode;
|
final Richcontent content = (Richcontent) element;
|
||||||
final String type = content.getTYPE();
|
final String type = content.getTYPE();
|
||||||
|
|
||||||
if (type.equals("NODE")) {
|
if (type.equals("NODE")) {
|
||||||
String text = getText(content);
|
String text = getText(content);
|
||||||
text = text.replaceAll("\n", "");
|
text = text.replaceAll("\n", "");
|
||||||
text = text.trim();
|
text = text.trim();
|
||||||
currentTopic.setText(text);
|
currentWiseTopic.setText(text);
|
||||||
} else {
|
} else {
|
||||||
String text = getRichContent(content);
|
String text = getRichContent(content);
|
||||||
final com.wisemapping.xml.mindmap.Note mindmapNote = new com.wisemapping.xml.mindmap.Note();
|
final com.wisemapping.xml.mindmap.Note mindmapNote = new com.wisemapping.xml.mindmap.Note();
|
||||||
text = text != null ? text.replaceAll("\n", "%0A") : EMPTY_NOTE;
|
text = text != null ? text.replaceAll("\n", "%0A") : EMPTY_NOTE;
|
||||||
mindmapNote.setText(text);
|
mindmapNote.setText(text);
|
||||||
currentTopic.setNote(mindmapNote);
|
currentWiseTopic.setNote(mindmapNote);
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if (freemindNode instanceof Arrowlink) {
|
} else if (element instanceof Arrowlink) {
|
||||||
final Arrowlink arrow = (Arrowlink) freemindNode;
|
final Arrowlink arrow = (Arrowlink) element;
|
||||||
RelationshipType relationship = mindmapObjectFactory.createRelationshipType();
|
RelationshipType relationship = mindmapObjectFactory.createRelationshipType();
|
||||||
String destId = arrow.getDESTINATION();
|
String destId = arrow.getDESTINATION();
|
||||||
relationship.setSrcTopicId(mainNode.getID());
|
relationship.setSrcTopicId(freeParent.getID());
|
||||||
relationship.setDestTopicId(destId);
|
relationship.setDestTopicId(destId);
|
||||||
String[] inclination = arrow.getENDINCLINATION().split(";");
|
String[] inclination = arrow.getENDINCLINATION().split(";");
|
||||||
relationship.setDestCtrlPoint(inclination[0] + "," + inclination[1]);
|
relationship.setDestCtrlPoint(inclination[0] + "," + inclination[1]);
|
||||||
@ -329,6 +308,91 @@ public class FreemindImporter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int calcFirstLevelOrder(@NotNull List<Object> freeChilden, @NotNull Node freeChild) {
|
||||||
|
final List<Node> nodes = new ArrayList<Node>();
|
||||||
|
int result;
|
||||||
|
if (freeChild.getWorder() != null) {
|
||||||
|
result = freeChild.getWorder().intValue();
|
||||||
|
} else {
|
||||||
|
for (Object child : freeChilden) {
|
||||||
|
if (child instanceof Node) {
|
||||||
|
Node node = (Node) child;
|
||||||
|
|
||||||
|
final String side = node.getPOSITION();
|
||||||
|
if (freeChild.getPOSITION().equals(side)) {
|
||||||
|
nodes.add(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// What is the index of the current node ?
|
||||||
|
int nodeIndex = 0;
|
||||||
|
for (Node node : nodes) {
|
||||||
|
if (node == freeChild) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
nodeIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
int size = ORDER_SEPARATION_FACTOR * nodes.size();
|
||||||
|
int center = (size - 1) / 2;
|
||||||
|
result = (nodeIndex * ORDER_SEPARATION_FACTOR) - center + ((size % 2 == 0) ? 0 : 1);
|
||||||
|
|
||||||
|
if (result > 0) {
|
||||||
|
result = (result - 1) * 2;
|
||||||
|
} else {
|
||||||
|
result = (result * -2) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Position is (x,y).
|
||||||
|
* x values greater than 0 are right axis
|
||||||
|
* x values lower than 0 are left axis
|
||||||
|
*/
|
||||||
|
private
|
||||||
|
@NotNull
|
||||||
|
String convertPosition(@NotNull TopicType wiseParent, @NotNull Node freeChild, final int depth, int order) {
|
||||||
|
|
||||||
|
// Which side must be the node be positioned ?
|
||||||
|
String result = freeChild.getWcoords();
|
||||||
|
if (result == null) {
|
||||||
|
|
||||||
|
final int xaxis;
|
||||||
|
int y;
|
||||||
|
if (depth == 1) {
|
||||||
|
|
||||||
|
final String side = freeChild.getPOSITION();
|
||||||
|
assert side != null : "This should not happen";
|
||||||
|
xaxis = POSITION_LEFT.equals(side) ? -1 : 1;
|
||||||
|
|
||||||
|
// 3 = -100 1
|
||||||
|
// 1 = -50 2
|
||||||
|
// 0 = 0 3
|
||||||
|
// 2 = 50 4
|
||||||
|
// 4 = 100 5
|
||||||
|
if (order % 2 == 0) {
|
||||||
|
y = HALF_ROOT_TOPICS_SEPARATION * order;
|
||||||
|
} else {
|
||||||
|
y = -HALF_ROOT_TOPICS_SEPARATION * (order + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
final String position = wiseParent.getPosition();
|
||||||
|
xaxis = isOnLeftSide(position) ? -1 : 1;
|
||||||
|
y = 100 * depth; // Todo: This is not right at all. This must be changed. Position must be calculated based on the parent position
|
||||||
|
|
||||||
|
}
|
||||||
|
int x = xaxis * 200 * depth;
|
||||||
|
result = x + "," + y;
|
||||||
|
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private String getRichContent(Richcontent content) {
|
private String getRichContent(Richcontent content) {
|
||||||
String result = null;
|
String result = null;
|
||||||
List<Element> elementList = content.getHtml().getAny();
|
List<Element> elementList = content.getHtml().getAny();
|
||||||
@ -346,6 +410,7 @@ public class FreemindImporter
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
private String getText(Richcontent content) {
|
private String getText(Richcontent content) {
|
||||||
String result = "";
|
String result = "";
|
||||||
List<Element> elementList = content.getHtml().getAny();
|
List<Element> elementList = content.getHtml().getAny();
|
||||||
@ -384,34 +449,30 @@ public class FreemindImporter
|
|||||||
return text.toString();
|
return text.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setNodePropertiesToTopic(@NotNull com.wisemapping.xml.mindmap.TopicType wiseTopic, @NotNull com.wisemapping.xml.freemind.Node freemindNode) {
|
private void convertNodeProperties(@NotNull com.wisemapping.xml.freemind.Node freeNode, @NotNull com.wisemapping.xml.mindmap.TopicType wiseTopic) {
|
||||||
wiseTopic.setText(freemindNode.getTEXT());
|
final String text = freeNode.getTEXT();
|
||||||
wiseTopic.setBgColor(freemindNode.getBACKGROUNDCOLOR());
|
wiseTopic.setText(text);
|
||||||
|
|
||||||
final String shape = getShapeFormFromNode(freemindNode);
|
final String bgcolor = freeNode.getBACKGROUNDCOLOR();
|
||||||
|
wiseTopic.setBgColor(bgcolor);
|
||||||
|
|
||||||
|
final String shape = getShapeFormFromNode(freeNode);
|
||||||
wiseTopic.setShape(shape);
|
wiseTopic.setShape(shape);
|
||||||
int pos = 1;
|
|
||||||
if (POSITION_LEFT.equals(freemindNode.getPOSITION())) {
|
|
||||||
pos = -1;
|
|
||||||
}
|
|
||||||
Integer orderPosition = wiseTopic.getOrder() != null ? wiseTopic.getOrder() : 0;
|
|
||||||
int position = pos * 200 + (orderPosition + 1) * 10;
|
|
||||||
|
|
||||||
wiseTopic.setPosition(position + "," + 200 * orderPosition);
|
final String fontStyle = generateFontStyle(freeNode, null);
|
||||||
final String fontStyle = generateFontStyle(freemindNode, null);
|
|
||||||
if (fontStyle != null) {
|
if (fontStyle != null) {
|
||||||
wiseTopic.setFontStyle(fontStyle);
|
wiseTopic.setFontStyle(fontStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is there any link ?
|
// Is there any link ?
|
||||||
final String url = freemindNode.getLINK();
|
final String url = freeNode.getLINK();
|
||||||
if (url != null) {
|
if (url != null) {
|
||||||
final Link link = new Link();
|
final Link link = new Link();
|
||||||
link.setUrl(url);
|
link.setUrl(url);
|
||||||
wiseTopic.setLink(link);
|
wiseTopic.setLink(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
final Boolean folded = Boolean.valueOf(freemindNode.getFOLDED());
|
final Boolean folded = Boolean.valueOf(freeNode.getFOLDED());
|
||||||
if (folded) {
|
if (folded) {
|
||||||
wiseTopic.setShrink(folded);
|
wiseTopic.setShrink(folded);
|
||||||
}
|
}
|
||||||
@ -477,7 +538,9 @@ public class FreemindImporter
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private @NotNull String getShapeFormFromNode(@NotNull Node node) {
|
private
|
||||||
|
@NotNull
|
||||||
|
String getShapeFormFromNode(@NotNull Node node) {
|
||||||
String result = node.getSTYLE();
|
String result = node.getSTYLE();
|
||||||
// In freemind a node without style is a line
|
// In freemind a node without style is a line
|
||||||
if ("bubble".equals(result)) {
|
if ("bubble".equals(result)) {
|
||||||
|
@ -18,28 +18,47 @@
|
|||||||
|
|
||||||
package com.wisemapping.util;
|
package com.wisemapping.util;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.xml.bind.JAXBContext;
|
import javax.xml.bind.JAXBContext;
|
||||||
import javax.xml.bind.JAXBException;
|
import javax.xml.bind.JAXBException;
|
||||||
import javax.xml.bind.Marshaller;
|
import javax.xml.bind.Marshaller;
|
||||||
import javax.xml.bind.Unmarshaller;
|
import javax.xml.bind.Unmarshaller;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class JAXBUtils {
|
public class JAXBUtils {
|
||||||
|
|
||||||
public static Object getMapObject(InputStream stream,String pakage) throws JAXBException {
|
private final static Map<String, JAXBContext> context = new HashMap<String, JAXBContext>();
|
||||||
|
|
||||||
final JAXBContext context = JAXBContext.newInstance(pakage);
|
public static Object getMapObject(@NotNull InputStream stream, @NotNull final String pakage) throws JAXBException {
|
||||||
final Unmarshaller unmarshaller = context.createUnmarshaller() ;
|
|
||||||
|
|
||||||
return unmarshaller.unmarshal (stream) ;
|
final JAXBContext context = getInstance(pakage);
|
||||||
|
final Unmarshaller unmarshaller = context.createUnmarshaller();
|
||||||
|
|
||||||
|
return unmarshaller.unmarshal(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void saveMap(Object obj, OutputStream out,String pakage) throws JAXBException {
|
private static JAXBContext getInstance(@NotNull String pakage) throws JAXBException {
|
||||||
|
|
||||||
final JAXBContext context = JAXBContext.newInstance(pakage);
|
JAXBContext result = context.get(pakage);
|
||||||
final Marshaller marshaller = context.createMarshaller();
|
if (result == null) {
|
||||||
|
synchronized (context) {
|
||||||
|
result = JAXBContext.newInstance(pakage);
|
||||||
|
context.put(pakage, result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
|
||||||
marshaller.marshal(obj, out) ;
|
}
|
||||||
|
|
||||||
|
public static void saveMap(@NotNull Object obj, @NotNull OutputStream out, String pachage) throws JAXBException {
|
||||||
|
|
||||||
|
final JAXBContext context = getInstance(pachage);
|
||||||
|
final Marshaller marshaller = context.createMarshaller();
|
||||||
|
|
||||||
|
marshaller.marshal(obj, out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,9 +26,9 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Java class for anonymous complex type.
|
* <p>Java class for anonymous complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType>
|
* <complexType>
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
@ -75,25 +75,23 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
|||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
@XmlType(name = "", propOrder = {
|
@XmlType(name = "", propOrder = {
|
||||||
"arrowlinkOrCloudOrEdge"
|
"arrowlinkOrCloudOrEdge"
|
||||||
})
|
})
|
||||||
@XmlRootElement(name = "node")
|
@XmlRootElement(name = "node")
|
||||||
public class Node {
|
public class Node {
|
||||||
|
|
||||||
@XmlElements({
|
@XmlElements({
|
||||||
@XmlElement(name = "icon", type = Icon.class),
|
@XmlElement(name = "icon", type = Icon.class),
|
||||||
@XmlElement(name = "node", type = Node.class),
|
@XmlElement(name = "node", type = Node.class),
|
||||||
@XmlElement(name = "edge", type = Edge.class),
|
@XmlElement(name = "edge", type = Edge.class),
|
||||||
@XmlElement(name = "arrowlink", type = Arrowlink.class),
|
@XmlElement(name = "arrowlink", type = Arrowlink.class),
|
||||||
@XmlElement(name = "font", type = Font.class),
|
@XmlElement(name = "font", type = Font.class),
|
||||||
@XmlElement(name = "hook", type = Hook.class),
|
@XmlElement(name = "hook", type = Hook.class),
|
||||||
@XmlElement(name = "richcontent", type = Richcontent.class),
|
@XmlElement(name = "richcontent", type = Richcontent.class),
|
||||||
@XmlElement(name = "cloud", type = Cloud.class)
|
@XmlElement(name = "cloud", type = Cloud.class)
|
||||||
})
|
})
|
||||||
protected List<Object> arrowlinkOrCloudOrEdge;
|
protected List<Object> arrowlinkOrCloudOrEdge;
|
||||||
@XmlAttribute(name = "BACKGROUND_COLOR")
|
@XmlAttribute(name = "BACKGROUND_COLOR")
|
||||||
@ -123,28 +121,35 @@ public class Node {
|
|||||||
protected BigInteger hgap;
|
protected BigInteger hgap;
|
||||||
@XmlAttribute(name = "VGAP")
|
@XmlAttribute(name = "VGAP")
|
||||||
protected BigInteger vgap;
|
protected BigInteger vgap;
|
||||||
|
|
||||||
@XmlAttribute(name = "VSHIFT")
|
@XmlAttribute(name = "VSHIFT")
|
||||||
protected BigInteger vshift;
|
protected BigInteger vshift;
|
||||||
@XmlAttribute(name = "ENCRYPTED_CONTENT")
|
@XmlAttribute(name = "ENCRYPTED_CONTENT")
|
||||||
protected String encryptedcontent;
|
protected String encryptedcontent;
|
||||||
|
|
||||||
|
// Wise Extensions
|
||||||
|
@XmlAttribute(name = "wCOORDS")
|
||||||
|
protected String wcoords;
|
||||||
|
@XmlAttribute(name = "WORDER")
|
||||||
|
protected BigInteger worder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the arrowlinkOrCloudOrEdge property.
|
* Gets the value of the arrowlinkOrCloudOrEdge property.
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p/>
|
||||||
* This accessor method returns a reference to the live list,
|
* This accessor method returns a reference to the live list,
|
||||||
* not a snapshot. Therefore any modification you make to the
|
* not a snapshot. Therefore any modification you make to the
|
||||||
* returned list will be present inside the JAXB object.
|
* returned list will be present inside the JAXB object.
|
||||||
* This is why there is not a <CODE>set</CODE> method for the arrowlinkOrCloudOrEdge property.
|
* This is why there is not a <CODE>set</CODE> method for the arrowlinkOrCloudOrEdge property.
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p/>
|
||||||
* For example, to add a new item, do as follows:
|
* For example, to add a new item, do as follows:
|
||||||
* <pre>
|
* <pre>
|
||||||
* getArrowlinkOrCloudOrEdge().add(newItem);
|
* getArrowlinkOrCloudOrEdge().add(newItem);
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p/>
|
||||||
* Objects of the following type(s) are allowed in the list
|
* Objects of the following type(s) are allowed in the list
|
||||||
* {@link Icon }
|
* {@link Icon }
|
||||||
* {@link Node }
|
* {@link Node }
|
||||||
@ -154,8 +159,6 @@ public class Node {
|
|||||||
* {@link Hook }
|
* {@link Hook }
|
||||||
* {@link Richcontent }
|
* {@link Richcontent }
|
||||||
* {@link Cloud }
|
* {@link Cloud }
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public List<Object> getArrowlinkOrCloudOrEdge() {
|
public List<Object> getArrowlinkOrCloudOrEdge() {
|
||||||
if (arrowlinkOrCloudOrEdge == null) {
|
if (arrowlinkOrCloudOrEdge == null) {
|
||||||
@ -166,11 +169,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the backgroundcolor property.
|
* Gets the value of the backgroundcolor property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public String getBACKGROUNDCOLOR() {
|
public String getBACKGROUNDCOLOR() {
|
||||||
return backgroundcolor;
|
return backgroundcolor;
|
||||||
@ -178,11 +179,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the backgroundcolor property.
|
* Sets the value of the backgroundcolor property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value allowed object is
|
||||||
* allowed object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void setBACKGROUNDCOLOR(String value) {
|
public void setBACKGROUNDCOLOR(String value) {
|
||||||
this.backgroundcolor = value;
|
this.backgroundcolor = value;
|
||||||
@ -190,23 +189,27 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the color property.
|
* Gets the value of the color property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public String getCOLOR() {
|
public String getCOLOR() {
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BigInteger getWorder() {
|
||||||
|
return worder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorder(BigInteger worder) {
|
||||||
|
this.worder = worder;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the color property.
|
* Sets the value of the color property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value allowed object is
|
||||||
* allowed object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void setCOLOR(String value) {
|
public void setCOLOR(String value) {
|
||||||
this.color = value;
|
this.color = value;
|
||||||
@ -214,11 +217,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the folded property.
|
* Gets the value of the folded property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public String getFOLDED() {
|
public String getFOLDED() {
|
||||||
return folded;
|
return folded;
|
||||||
@ -226,11 +227,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the folded property.
|
* Sets the value of the folded property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value allowed object is
|
||||||
* allowed object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void setFOLDED(String value) {
|
public void setFOLDED(String value) {
|
||||||
this.folded = value;
|
this.folded = value;
|
||||||
@ -238,11 +237,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the id property.
|
* Gets the value of the id property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public String getID() {
|
public String getID() {
|
||||||
return id;
|
return id;
|
||||||
@ -250,11 +247,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the id property.
|
* Sets the value of the id property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value allowed object is
|
||||||
* allowed object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void setID(String value) {
|
public void setID(String value) {
|
||||||
this.id = value;
|
this.id = value;
|
||||||
@ -262,11 +257,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the link property.
|
* Gets the value of the link property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public String getLINK() {
|
public String getLINK() {
|
||||||
return link;
|
return link;
|
||||||
@ -274,11 +267,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the link property.
|
* Sets the value of the link property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value allowed object is
|
||||||
* allowed object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void setLINK(String value) {
|
public void setLINK(String value) {
|
||||||
this.link = value;
|
this.link = value;
|
||||||
@ -286,11 +277,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the position property.
|
* Gets the value of the position property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public String getPOSITION() {
|
public String getPOSITION() {
|
||||||
return position;
|
return position;
|
||||||
@ -298,11 +287,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the position property.
|
* Sets the value of the position property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value allowed object is
|
||||||
* allowed object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void setPOSITION(String value) {
|
public void setPOSITION(String value) {
|
||||||
this.position = value;
|
this.position = value;
|
||||||
@ -310,11 +297,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the style property.
|
* Gets the value of the style property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public String getSTYLE() {
|
public String getSTYLE() {
|
||||||
return style;
|
return style;
|
||||||
@ -322,11 +307,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the style property.
|
* Sets the value of the style property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value allowed object is
|
||||||
* allowed object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void setSTYLE(String value) {
|
public void setSTYLE(String value) {
|
||||||
this.style = value;
|
this.style = value;
|
||||||
@ -334,11 +317,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the text property.
|
* Gets the value of the text property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public String getTEXT() {
|
public String getTEXT() {
|
||||||
return text;
|
return text;
|
||||||
@ -346,11 +327,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the text property.
|
* Sets the value of the text property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value allowed object is
|
||||||
* allowed object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void setTEXT(String value) {
|
public void setTEXT(String value) {
|
||||||
this.text = value;
|
this.text = value;
|
||||||
@ -358,11 +337,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the created property.
|
* Gets the value of the created property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link BigInteger }
|
||||||
* {@link BigInteger }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public BigInteger getCREATED() {
|
public BigInteger getCREATED() {
|
||||||
return created;
|
return created;
|
||||||
@ -370,11 +347,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the created property.
|
* Sets the value of the created property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value allowed object is
|
||||||
* allowed object is
|
* {@link BigInteger }
|
||||||
* {@link BigInteger }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void setCREATED(BigInteger value) {
|
public void setCREATED(BigInteger value) {
|
||||||
this.created = value;
|
this.created = value;
|
||||||
@ -382,23 +357,27 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the modified property.
|
* Gets the value of the modified property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link BigInteger }
|
||||||
* {@link BigInteger }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public BigInteger getMODIFIED() {
|
public BigInteger getMODIFIED() {
|
||||||
return modified;
|
return modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getWcoords() {
|
||||||
|
return wcoords;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWcoords(String wcoords) {
|
||||||
|
this.wcoords = wcoords;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the modified property.
|
* Sets the value of the modified property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value allowed object is
|
||||||
* allowed object is
|
* {@link BigInteger }
|
||||||
* {@link BigInteger }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void setMODIFIED(BigInteger value) {
|
public void setMODIFIED(BigInteger value) {
|
||||||
this.modified = value;
|
this.modified = value;
|
||||||
@ -406,11 +385,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the hgap property.
|
* Gets the value of the hgap property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link BigInteger }
|
||||||
* {@link BigInteger }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public BigInteger getHGAP() {
|
public BigInteger getHGAP() {
|
||||||
return hgap;
|
return hgap;
|
||||||
@ -418,11 +395,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the hgap property.
|
* Sets the value of the hgap property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value allowed object is
|
||||||
* allowed object is
|
* {@link BigInteger }
|
||||||
* {@link BigInteger }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void setHGAP(BigInteger value) {
|
public void setHGAP(BigInteger value) {
|
||||||
this.hgap = value;
|
this.hgap = value;
|
||||||
@ -430,11 +405,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the vgap property.
|
* Gets the value of the vgap property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link BigInteger }
|
||||||
* {@link BigInteger }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public BigInteger getVGAP() {
|
public BigInteger getVGAP() {
|
||||||
return vgap;
|
return vgap;
|
||||||
@ -442,11 +415,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the vgap property.
|
* Sets the value of the vgap property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value allowed object is
|
||||||
* allowed object is
|
* {@link BigInteger }
|
||||||
* {@link BigInteger }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void setVGAP(BigInteger value) {
|
public void setVGAP(BigInteger value) {
|
||||||
this.vgap = value;
|
this.vgap = value;
|
||||||
@ -454,11 +425,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the vshift property.
|
* Gets the value of the vshift property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link BigInteger }
|
||||||
* {@link BigInteger }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public BigInteger getVSHIFT() {
|
public BigInteger getVSHIFT() {
|
||||||
return vshift;
|
return vshift;
|
||||||
@ -466,11 +435,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the vshift property.
|
* Sets the value of the vshift property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value allowed object is
|
||||||
* allowed object is
|
* {@link BigInteger }
|
||||||
* {@link BigInteger }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void setVSHIFT(BigInteger value) {
|
public void setVSHIFT(BigInteger value) {
|
||||||
this.vshift = value;
|
this.vshift = value;
|
||||||
@ -478,11 +445,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the encryptedcontent property.
|
* Gets the value of the encryptedcontent property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public String getENCRYPTEDCONTENT() {
|
public String getENCRYPTEDCONTENT() {
|
||||||
return encryptedcontent;
|
return encryptedcontent;
|
||||||
@ -490,11 +455,9 @@ public class Node {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the encryptedcontent property.
|
* Sets the value of the encryptedcontent property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value allowed object is
|
||||||
* allowed object is
|
* {@link String }
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void setENCRYPTEDCONTENT(String value) {
|
public void setENCRYPTEDCONTENT(String value) {
|
||||||
this.encryptedcontent = value;
|
this.encryptedcontent = value;
|
||||||
|
@ -149,6 +149,9 @@
|
|||||||
<xs:attribute name='MODIFIED' type='xs:integer' use='optional'/>
|
<xs:attribute name='MODIFIED' type='xs:integer' use='optional'/>
|
||||||
<xs:attribute name='HGAP' type='xs:integer' use='optional'/>
|
<xs:attribute name='HGAP' type='xs:integer' use='optional'/>
|
||||||
<xs:attribute name='VGAP' type='xs:integer' use='optional'/>
|
<xs:attribute name='VGAP' type='xs:integer' use='optional'/>
|
||||||
|
<xs:attribute name='WCOORDS' type='xs:string' use='optional'/>
|
||||||
|
<xs:attribute name='WORDER' type='xs:integer' use='optional'/>
|
||||||
|
|
||||||
<xs:attribute name='VSHIFT' type='xs:integer' use='optional'/>
|
<xs:attribute name='VSHIFT' type='xs:integer' use='optional'/>
|
||||||
<xs:attribute name='ENCRYPTED_CONTENT' type='xs:string' use='optional'/>
|
<xs:attribute name='ENCRYPTED_CONTENT' type='xs:string' use='optional'/>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
@ -1 +1 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="0.9.0"><node TEXT="This is the root node" ID="ID_0"><node TEXT="Child Level 1 Right 1" POSITION="right" ID="ID_1"/><node TEXT="Child Level 1 Left 1" POSITION="left" ID="ID_2"><node TEXT="Child Level 2 Left 11" POSITION="left" ID="ID_3"/><node TEXT="Child Level 2 Left 12" POSITION="left" ID="ID_4"/></node><node TEXT="Child Level 1 Right 2" POSITION="right" ID="ID_5"/><node TEXT="Child Level 1 Left 2" POSITION="left" ID="ID_6"><node TEXT="Child Level 2 Left 21 " POSITION="left" ID="ID_7"/><node TEXT="Child Level 2 Left 22" POSITION="left" ID="ID_8"/></node></node></map>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="0.9.0"><node TEXT="This is the root node" ID="ID_0"><node WORDER="3" wCOORDS="200,-100" TEXT="Child Level 1 Right 1" POSITION="right" ID="ID_1"/><node WORDER="3" wCOORDS="-200,-100" TEXT="Child Level 1 Left 1" POSITION="left" ID="ID_2"><node WORDER="0" wCOORDS="-400,200" TEXT="Child Level 2 Left 11" POSITION="left" ID="ID_3"/><node WORDER="1" wCOORDS="-400,200" TEXT="Child Level 2 Left 12" POSITION="left" ID="ID_4"/></node><node WORDER="0" wCOORDS="200,0" TEXT="Child Level 1 Right 2" POSITION="right" ID="ID_5"/><node WORDER="0" wCOORDS="-200,0" TEXT="Child Level 1 Left 2" POSITION="left" ID="ID_6"><node WORDER="0" wCOORDS="-400,200" TEXT="Child Level 2 Left 21 " POSITION="left" ID="ID_7"/><node WORDER="1" wCOORDS="-400,200" TEXT="Child Level 2 Left 22" POSITION="left" ID="ID_8"/></node></node></map>
|
1
wise-webapp/src/test/data/freemind/basic.wxml
Normal file
1
wise-webapp/src/test/data/freemind/basic.wxml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="pela" name="basic"><topic id="0" central="true" shape="rounded rectagle" text="This is the root node"><topic id="1" position="200,-100" order="3" shape="line" text="Child Level 1 Right 1"/><topic id="2" position="-200,-100" order="3" shape="line" text="Child Level 1 Left 1"><topic id="3" position="-400,200" order="0" shape="line" text="Child Level 2 Left 11"/><topic id="4" position="-400,200" order="1" shape="line" text="Child Level 2 Left 12"/></topic><topic id="5" position="200,0" order="0" shape="line" text="Child Level 1 Right 2"/><topic id="6" position="-200,0" order="0" shape="line" text="Child Level 1 Left 2"><topic id="7" position="-400,200" order="0" shape="line" text="Child Level 2 Left 21 "/><topic id="8" position="-400,200" order="1" shape="line" text="Child Level 2 Left 22"/></topic></topic></map>
|
@ -1 +1 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="0.9.0"><node TEXT="Fonts" ID="ID_0"><node TEXT="Styles" POSITION="right" ID="ID_1"><node TEXT="Bold" POSITION="right" ID="ID_2"><font SIZE="12" NAME="Arial" BOLD="true"/></node><node TEXT="Italic" POSITION="right" ID="ID_3"><font SIZE="12" NAME="Arial" ITALIC="true"/></node></node><node TEXT="Sizes" POSITION="left" ID="ID_4"><node TEXT="Normal----" POSITION="left" ID="ID_5"><font SIZE="8" NAME="Arial"/></node><node TEXT="Normal---" POSITION="left" ID="ID_6"><font SIZE="9" NAME="Arial"/></node><node TEXT="Normal--" POSITION="left" ID="ID_7"><font SIZE="10" NAME="Arial"/></node><node TEXT="Normal-" POSITION="left" ID="ID_8"><font SIZE="11" NAME="Arial"/></node><node TEXT="Normal" POSITION="left" ID="ID_9"/><node TEXT="Nomal+" POSITION="left" ID="ID_10"><font SIZE="13" NAME="Arial"/></node><node TEXT="Normal++" POSITION="left" ID="ID_11"><font SIZE="14" NAME="Arial"/></node><node TEXT="Normal+++" POSITION="left" ID="ID_12"><font SIZE="15" NAME="Arial"/></node><node TEXT="Normal++++" POSITION="left" ID="ID_13"><font SIZE="16" NAME="Arial"/></node></node></node></map>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="0.9.0"><node TEXT="Fonts" ID="ID_0"><node WORDER="1" wCOORDS="200,-50" TEXT="Styles" POSITION="right" ID="ID_1"><node WORDER="0" wCOORDS="400,200" TEXT="Bold" POSITION="right" ID="ID_2"><font SIZE="12" NAME="Arial" BOLD="true"/></node><node WORDER="1" wCOORDS="400,200" TEXT="Italic" POSITION="right" ID="ID_3"><font SIZE="12" NAME="Arial" ITALIC="true"/></node></node><node WORDER="1" wCOORDS="-200,-50" TEXT="Sizes" POSITION="left" ID="ID_4"><node WORDER="0" wCOORDS="-400,200" TEXT="Normal----" POSITION="left" ID="ID_5"><font SIZE="8" NAME="Arial"/></node><node WORDER="1" wCOORDS="-400,200" TEXT="Normal---" POSITION="left" ID="ID_6"><font SIZE="9" NAME="Arial"/></node><node WORDER="2" wCOORDS="-400,200" TEXT="Normal--" POSITION="left" ID="ID_7"><font SIZE="10" NAME="Arial"/></node><node WORDER="3" wCOORDS="-400,200" TEXT="Normal-" POSITION="left" ID="ID_8"><font SIZE="11" NAME="Arial"/></node><node WORDER="4" wCOORDS="-400,200" TEXT="Normal" POSITION="left" ID="ID_9"/><node WORDER="5" wCOORDS="-400,200" TEXT="Nomal+" POSITION="left" ID="ID_10"><font SIZE="13" NAME="Arial"/></node><node WORDER="6" wCOORDS="-400,200" TEXT="Normal++" POSITION="left" ID="ID_11"><font SIZE="14" NAME="Arial"/></node><node WORDER="7" wCOORDS="-400,200" TEXT="Normal+++" POSITION="left" ID="ID_12"><font SIZE="15" NAME="Arial"/></node><node WORDER="8" wCOORDS="-400,200" TEXT="Normal++++" POSITION="left" ID="ID_13"><font SIZE="16" NAME="Arial"/></node></node></node></map>
|
1
wise-webapp/src/test/data/freemind/fonts.wxml
Normal file
1
wise-webapp/src/test/data/freemind/fonts.wxml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="pela" name="basic"><topic id="0" central="true" shape="rounded rectagle" text="Fonts"><topic id="1" position="200,-50" order="1" shape="line" text="Styles"><topic id="2" position="400,200" order="0" fontStyle="Arial;12;;bold;;" shape="line" text="Bold"/><topic id="3" position="400,200" order="1" fontStyle="Arial;12;;;italic;" shape="line" text="Italic"/></topic><topic id="4" position="-200,-50" order="1" shape="line" text="Sizes"><topic id="5" position="-400,200" order="0" fontStyle="Arial;8;;;;" shape="line" text="Normal----"/><topic id="6" position="-400,200" order="1" fontStyle="Arial;9;;;;" shape="line" text="Normal---"/><topic id="7" position="-400,200" order="2" fontStyle="Arial;10;;;;" shape="line" text="Normal--"/><topic id="8" position="-400,200" order="3" fontStyle="Arial;11;;;;" shape="line" text="Normal-"/><topic id="9" position="-400,200" order="4" shape="line" text="Normal"/><topic id="10" position="-400,200" order="5" fontStyle="Arial;13;;;;" shape="line" text="Nomal+"/><topic id="11" position="-400,200" order="6" fontStyle="Arial;14;;;;" shape="line" text="Normal++"/><topic id="12" position="-400,200" order="7" fontStyle="Arial;15;;;;" shape="line" text="Normal+++"/><topic id="13" position="-400,200" order="8" fontStyle="Arial;16;;;;" shape="line" text="Normal++++"/></topic></topic></map>
|
File diff suppressed because one or more lines are too long
1
wise-webapp/src/test/data/freemind/icons.wxml
Normal file
1
wise-webapp/src/test/data/freemind/icons.wxml
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="0.9.0"><node TEXT="Node Links" LINK="http://www.google.com" ID="ID_0"><icon BUILTIN="closed"/><node TEXT="Link Topic" POSITION="right" LINK="http://www.bing.com" ID="ID_1" FOLDED="true"><icon BUILTIN="info"/><node TEXT="Link Topic Topic" POSITION="right" LINK="http://bing.com" ID="ID_2"><icon BUILTIN="messagebox_warning"/></node></node></node></map>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="0.9.0"><node TEXT="Node Links" LINK="http://www.google.com" ID="ID_0"><icon BUILTIN="closed"/><node WORDER="1" wCOORDS="200,-50" TEXT="Link Topic" POSITION="right" LINK="http://www.bing.com" ID="ID_1" FOLDED="true"><icon BUILTIN="info"/><node WORDER="0" wCOORDS="400,200" TEXT="Link Topic Topic" POSITION="right" LINK="http://bing.com" ID="ID_2"><icon BUILTIN="messagebox_warning"/></node></node></node></map>
|
1
wise-webapp/src/test/data/freemind/links.wxml
Normal file
1
wise-webapp/src/test/data/freemind/links.wxml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="pela" name="basic"><topic id="0" central="true" shape="rounded rectagle" text="Node Links"><icon id="onoff_delete"/><link url="http://www.google.com"/><topic shrink="true" id="1" position="200,-50" order="1" shape="line" text="Link Topic"><icon id="sign_info"/><link url="http://www.bing.com"/><topic id="2" position="400,200" order="0" shape="line" text="Link Topic Topic"><icon id="sign_warning"/><link url="http://bing.com"/></topic></topic></topic></map>
|
@ -1 +1 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="0.9.0"><node TEXT="Shapes" ID="ID_0"><node TEXT="Node Styles" POSITION="right" ID="ID_1"><node TEXT="Fork" POSITION="right" ID="ID_2"><edge COLOR="#808080"/></node><node TEXT="Bubble" STYLE="bubble" POSITION="right" ID="ID_3"><edge COLOR="#808080"/></node><node TEXT="As parent" POSITION="right" ID="ID_4"><edge COLOR="#808080"/></node><node TEXT="Combined" POSITION="right" ID="ID_5"><edge COLOR="#808080"/></node></node><node TEXT="Node Background Color" POSITION="left" ID="ID_6" BACKGROUND_COLOR="#f20707"><node TEXT="Fork" POSITION="left" ID="ID_7" BACKGROUND_COLOR="#0000cc"><edge COLOR="#808080"/></node><node TEXT="Bubble" STYLE="bubble" POSITION="left" ID="ID_8" BACKGROUND_COLOR="#ccffcc"><edge COLOR="#808080"/></node><node TEXT="As parent" POSITION="left" ID="ID_9" BACKGROUND_COLOR="#00ffff"><edge COLOR="#808080"/></node><node TEXT="Combined" POSITION="left" ID="ID_10" BACKGROUND_COLOR="#990099"><edge COLOR="#808080"/></node></node><node TEXT="Node Text Color" POSITION="left" ID="ID_11" BACKGROUND_COLOR="#f20707"><node TEXT="Fork" POSITION="left" ID="ID_12" COLOR="#ffff00" BACKGROUND_COLOR="#0000cc"><edge COLOR="#808080"/></node><node TEXT="Bubble" STYLE="bubble" POSITION="left" ID="ID_13" COLOR="#ff6666" BACKGROUND_COLOR="#ccffcc"><edge COLOR="#808080"/></node><node TEXT="As parent" POSITION="left" ID="ID_14" COLOR="#009999" BACKGROUND_COLOR="#00ffff"><edge COLOR="#808080"/></node><node TEXT="Combined" POSITION="left" ID="ID_15" COLOR="#009999" BACKGROUND_COLOR="#990099"><edge COLOR="#808080"/></node></node></node></map>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="0.9.0"><node TEXT="Shapes" ID="ID_0"><node WORDER="1" wCOORDS="200,-50" TEXT="Node Styles" POSITION="right" ID="ID_1"><node WORDER="0" wCOORDS="400,200" TEXT="Fork" POSITION="right" ID="ID_2"><edge COLOR="#808080"/></node><node WORDER="1" wCOORDS="400,200" TEXT="Bubble" STYLE="bubble" POSITION="right" ID="ID_3"><edge COLOR="#808080"/></node><node WORDER="2" wCOORDS="400,200" TEXT="As parent" POSITION="right" ID="ID_4"><edge COLOR="#808080"/></node><node WORDER="3" wCOORDS="400,200" TEXT="Combined" POSITION="right" ID="ID_5"><edge COLOR="#808080"/></node></node><node WORDER="3" wCOORDS="-200,-100" TEXT="Node Background Color" POSITION="left" ID="ID_6" BACKGROUND_COLOR="#f20707"><node WORDER="0" wCOORDS="-400,200" TEXT="Fork" POSITION="left" ID="ID_7" BACKGROUND_COLOR="#0000cc"><edge COLOR="#808080"/></node><node WORDER="1" wCOORDS="-400,200" TEXT="Bubble" STYLE="bubble" POSITION="left" ID="ID_8" BACKGROUND_COLOR="#ccffcc"><edge COLOR="#808080"/></node><node WORDER="2" wCOORDS="-400,200" TEXT="As parent" POSITION="left" ID="ID_9" BACKGROUND_COLOR="#00ffff"><edge COLOR="#808080"/></node><node WORDER="3" wCOORDS="-400,200" TEXT="Combined" POSITION="left" ID="ID_10" BACKGROUND_COLOR="#990099"><edge COLOR="#808080"/></node></node><node WORDER="0" wCOORDS="-200,0" TEXT="Node Text Color" POSITION="left" ID="ID_11" BACKGROUND_COLOR="#f20707"><node WORDER="0" wCOORDS="-400,200" TEXT="Fork" POSITION="left" ID="ID_12" COLOR="#ffff00" BACKGROUND_COLOR="#0000cc"><edge COLOR="#808080"/></node><node WORDER="1" wCOORDS="-400,200" TEXT="Bubble" STYLE="bubble" POSITION="left" ID="ID_13" COLOR="#ff6666" BACKGROUND_COLOR="#ccffcc"><edge COLOR="#808080"/></node><node WORDER="2" wCOORDS="-400,200" TEXT="As parent" POSITION="left" ID="ID_14" COLOR="#009999" BACKGROUND_COLOR="#00ffff"><edge COLOR="#808080"/></node><node WORDER="3" wCOORDS="-400,200" TEXT="Combined" POSITION="left" ID="ID_15" COLOR="#009999" BACKGROUND_COLOR="#990099"><edge COLOR="#808080"/></node></node></node></map>
|
1
wise-webapp/src/test/data/freemind/node-styles.wxml
Normal file
1
wise-webapp/src/test/data/freemind/node-styles.wxml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="pela" name="basic"><topic id="0" central="true" shape="rounded rectagle" text="Shapes"><topic id="1" position="200,-50" order="1" shape="line" text="Node Styles"><topic id="2" position="400,200" order="0" brColor="#808080" shape="line" text="Fork"/><topic id="3" position="400,200" order="1" brColor="#808080" shape="rounded rectagle" text="Bubble"/><topic id="4" position="400,200" order="2" brColor="#808080" shape="line" text="As parent"/><topic id="5" position="400,200" order="3" brColor="#808080" shape="line" text="Combined"/></topic><topic id="6" position="-200,-100" order="3" bgColor="#f20707" shape="line" text="Node Background Color"><topic id="7" position="-400,200" order="0" brColor="#808080" bgColor="#0000cc" shape="line" text="Fork"/><topic id="8" position="-400,200" order="1" brColor="#808080" bgColor="#ccffcc" shape="rounded rectagle" text="Bubble"/><topic id="9" position="-400,200" order="2" brColor="#808080" bgColor="#00ffff" shape="line" text="As parent"/><topic id="10" position="-400,200" order="3" brColor="#808080" bgColor="#990099" shape="line" text="Combined"/></topic><topic id="11" position="-200,0" order="0" bgColor="#f20707" shape="line" text="Node Text Color"><topic id="12" position="-400,200" order="0" brColor="#808080" bgColor="#0000cc" fontStyle=";;#ffff00;;;" shape="line" text="Fork"/><topic id="13" position="-400,200" order="1" brColor="#808080" bgColor="#ccffcc" fontStyle=";;#ff6666;;;" shape="rounded rectagle" text="Bubble"/><topic id="14" position="-400,200" order="2" brColor="#808080" bgColor="#00ffff" fontStyle=";;#009999;;;" shape="line" text="As parent"/><topic id="15" position="-400,200" order="3" brColor="#808080" bgColor="#990099" fontStyle=";;#009999;;;" shape="line" text="Combined"/></topic></topic></map>
|
@ -29,45 +29,65 @@ public class ImportExportTest {
|
|||||||
|
|
||||||
|
|
||||||
@Test(dataProvider = "Data-Provider-Function")
|
@Test(dataProvider = "Data-Provider-Function")
|
||||||
public void exportImportExportTest(@NotNull final File freeMindFile, @NotNull final File recFile) throws ImporterException, IOException, ExportException {
|
public void exportImportExportTest(@NotNull final File freeMindFile, @NotNull final File wiseFile, @NotNull final File freeRecFile) throws ImporterException, IOException, ExportException {
|
||||||
|
|
||||||
|
|
||||||
FileInputStream fileInputStream = new FileInputStream(freeMindFile.getAbsolutePath());
|
final FileInputStream fileInputStream = new FileInputStream(freeMindFile.getAbsolutePath());
|
||||||
final MindMap mindMap = importer.importMap("basic", "basic", fileInputStream);
|
final MindMap mindMap = importer.importMap("basic", "basic", fileInputStream);
|
||||||
|
|
||||||
if (recFile.exists()) {
|
|
||||||
|
// Compare mindmap output ...
|
||||||
|
if (wiseFile.exists()) {
|
||||||
// Compare rec and file ...
|
// Compare rec and file ...
|
||||||
|
final String recContent = readFile(wiseFile);
|
||||||
|
|
||||||
// Load rec file co
|
// Export mile content ...
|
||||||
final FileInputStream fis = new FileInputStream(recFile);
|
Assert.assertEquals(mindMap.getUnzippedXml(), recContent);
|
||||||
final InputStreamReader isr = new InputStreamReader(fis);
|
|
||||||
final BufferedReader br = new BufferedReader(isr);
|
|
||||||
|
|
||||||
final StringBuilder recContent = new StringBuilder();
|
} else {
|
||||||
String line = br.readLine();
|
final FileOutputStream fos = new FileOutputStream(wiseFile);
|
||||||
while (line != null) {
|
fos.write(mindMap.getUnzippedXml().getBytes());
|
||||||
recContent.append(line);
|
fos.close();
|
||||||
line = br.readLine();
|
}
|
||||||
|
|
||||||
}
|
// Compare freemind output ...
|
||||||
|
if (freeRecFile.exists()) {
|
||||||
fis.close();
|
// Compare rec and file ...
|
||||||
|
final String recContent = readFile(freeRecFile);
|
||||||
|
|
||||||
// Export mile content ...
|
// Export mile content ...
|
||||||
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||||
exporter.export(mindMap, bos);
|
exporter.export(mindMap, bos);
|
||||||
final String exportContent = new String(bos.toByteArray());
|
final String exportContent = new String(bos.toByteArray());
|
||||||
|
|
||||||
Assert.assertEquals(recContent.toString(), exportContent);
|
Assert.assertEquals(exportContent, recContent);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
final FileOutputStream fos = new FileOutputStream(recFile);
|
final FileOutputStream fos = new FileOutputStream(freeRecFile);
|
||||||
exporter.export(mindMap, fos);
|
exporter.export(mindMap, fos);
|
||||||
fos.close();
|
fos.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String readFile(@NotNull File file) throws IOException {
|
||||||
|
// Load rec file co
|
||||||
|
final FileInputStream fis = new FileInputStream(file);
|
||||||
|
final InputStreamReader isr = new InputStreamReader(fis);
|
||||||
|
final BufferedReader br = new BufferedReader(isr);
|
||||||
|
|
||||||
|
final StringBuilder result = new StringBuilder();
|
||||||
|
String line = br.readLine();
|
||||||
|
while (line != null) {
|
||||||
|
result.append(line);
|
||||||
|
line = br.readLine();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fis.close();
|
||||||
|
return result.toString();
|
||||||
|
}
|
||||||
|
|
||||||
//This function will provide the parameter data
|
//This function will provide the parameter data
|
||||||
@DataProvider(name = "Data-Provider-Function")
|
@DataProvider(name = "Data-Provider-Function")
|
||||||
public Object[][] parameterIntTestProvider() {
|
public Object[][] parameterIntTestProvider() {
|
||||||
@ -84,7 +104,8 @@ public class ImportExportTest {
|
|||||||
for (int i = 0; i < freeMindFiles.length; i++) {
|
for (int i = 0; i < freeMindFiles.length; i++) {
|
||||||
File freeMindFile = freeMindFiles[i];
|
File freeMindFile = freeMindFiles[i];
|
||||||
final String name = freeMindFile.getName();
|
final String name = freeMindFile.getName();
|
||||||
result[i] = new Object[]{freeMindFile, new File(DATA_DIR_PATH, name.substring(0, name.lastIndexOf(".")) + ".mmr")};
|
String testName = name.substring(0, name.lastIndexOf("."));
|
||||||
|
result[i] = new Object[]{freeMindFile, new File(DATA_DIR_PATH, testName + ".wxml"), new File(DATA_DIR_PATH, testName + ".mmr")};
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
Reference in New Issue
Block a user