- Fix remove icon position

- Import don't use elipse for freemind anymore
-
This commit is contained in:
Paulo Gustavo Veiga
2011-03-28 00:22:20 -03:00
parent a527404aa2
commit 6d1b678c48
10 changed files with 65 additions and 48 deletions

View File

@@ -22,7 +22,9 @@ import com.wisemapping.exporter.ExportException;
import com.wisemapping.exporter.Exporter;
import com.wisemapping.importer.freemind.FreemindIconConverter;
import com.wisemapping.model.MindMap;
import com.wisemapping.model.ShapeStyle;
import com.wisemapping.util.JAXBUtils;
import com.wisemapping.xml.Style;
import com.wisemapping.xml.freemind.*;
import com.wisemapping.xml.mindmap.RelationshipType;
import com.wisemapping.xml.mindmap.TopicType;
@@ -90,7 +92,7 @@ public class FreemindExporter
freemindMap.setNode(main);
if (centerTopic != null) {
nodesMap.put(centerTopic.getId(), main);
setTopicPropertiesToNode(main, centerTopic);
setTopicPropertiesToNode(main, centerTopic, true);
addNodeFromTopic(centerTopic, main);
}
List<RelationshipType> relationships = mindmapMap.getRelationship();
@@ -119,7 +121,7 @@ public class FreemindExporter
for (TopicType topicType : currentTopic) {
final Node newNode = objectFactory.createNode();
nodesMap.put(topicType.getId(), newNode);
setTopicPropertiesToNode(newNode, topicType);
setTopicPropertiesToNode(newNode, topicType, false);
destNode.getArrowlinkOrCloudOrEdge().add(newNode);
addNodeFromTopic(topicType, newNode);
final String position = topicType.getPosition();
@@ -131,29 +133,33 @@ public class FreemindExporter
}
}
private void setTopicPropertiesToNode(com.wisemapping.xml.freemind.Node freemindNode, com.wisemapping.xml.mindmap.TopicType mindmapTopic) {
private void setTopicPropertiesToNode(@NotNull com.wisemapping.xml.freemind.Node freemindNode, @NotNull com.wisemapping.xml.mindmap.TopicType mindmapTopic, boolean isRoot) {
freemindNode.setID("ID_" + mindmapTopic.getId());
freemindNode.setTEXT(mindmapTopic.getText());
freemindNode.setBACKGROUNDCOLOR(mindmapTopic.getBgColor());
if (mindmapTopic.getShape() != null && !mindmapTopic.getShape().equals("line")) {
String style = mindmapTopic.getShape();
if ("rounded rectagle".equals(mindmapTopic.getShape())) {
style = "bubble";
final String shape = mindmapTopic.getShape();
if (shape != null && !shape.isEmpty()) {
if ( isRoot && !ShapeStyle.ROUNDED_RETAGLE.getStyle().endsWith(shape) || !isRoot && !ShapeStyle.LINE.getStyle().endsWith(shape) ) {
String style = shape;
if (ShapeStyle.ROUNDED_RETAGLE.getStyle().equals(shape)) {
style = "bubble";
}
freemindNode.setSTYLE(style);
}
freemindNode.setSTYLE(style);
addIconNode(freemindNode, mindmapTopic);
addLinkNode(freemindNode, mindmapTopic);
addFontNode(freemindNode, mindmapTopic);
addEdgeNode(freemindNode, mindmapTopic);
addNote(freemindNode, mindmapTopic);
Boolean shrink = mindmapTopic.isShrink();
if (shrink != null && shrink)
freemindNode.setFOLDED(String.valueOf(shrink));
}
addIconNode(freemindNode, mindmapTopic);
addLinkNode(freemindNode, mindmapTopic);
addFontNode(freemindNode, mindmapTopic);
addEdgeNode(freemindNode, mindmapTopic);
addNote(freemindNode, mindmapTopic);
Boolean shrink = mindmapTopic.isShrink();
if (shrink != null && shrink)
freemindNode.setFOLDED(String.valueOf(shrink));
}
private void addNote(com.wisemapping.xml.freemind.Node freemindNode, com.wisemapping.xml.mindmap.TopicType mindmapTopic) {

View File

@@ -74,7 +74,7 @@ public class FreemindImporter
centralTopic.setCentral(true);
setNodePropertiesToTopic(centralTopic, centralNode);
centralTopic.setShape(ShapeStyle.ELIPSE.getStyle());
centralTopic.setShape(ShapeStyle.ROUNDED_RETAGLE.getStyle());
mindmapMap.getTopic().add(centralTopic);
mindmapMap.setName(mapName);
@@ -104,7 +104,7 @@ public class FreemindImporter
return map;
}
private void addRelationships(com.wisemapping.xml.mindmap.Map mindmapMap) {
private void addRelationships(@NotNull com.wisemapping.xml.mindmap.Map mindmapMap) {
List<RelationshipType> mapRelationships = mindmapMap.getRelationship();
for (RelationshipType relationship : relationships) {
relationship.setId(String.valueOf(currentId++));
@@ -155,7 +155,7 @@ public class FreemindImporter
}
private void fixCentralTopicChildOrder(TopicType centralTopic) {
private void fixCentralTopicChildOrder(@NotNull TopicType centralTopic) {
List<TopicType> topics = centralTopic.getTopic();
List<TopicType> leftTopics = new ArrayList<TopicType>();
List<TopicType> rightTopics = new ArrayList<TopicType>();
@@ -479,14 +479,14 @@ public class FreemindImporter
return result;
}
private String getShapeFormFromNode(Node node) {
String shape = node.getSTYLE();
private @NotNull String getShapeFormFromNode(@NotNull Node node) {
String result = node.getSTYLE();
// In freemind a node without style is a line
if ("bubble".equals(shape)) {
shape = ShapeStyle.ROUNDED_RETAGLE.getStyle();
if ("bubble".equals(result)) {
result = ShapeStyle.ROUNDED_RETAGLE.getStyle();
} else {
shape = ShapeStyle.LINE.getStyle();
result = ShapeStyle.LINE.getStyle();
}
return shape;
return result;
}
}

View File

@@ -1,4 +1,4 @@
- Node Links
- Done: Node Links
- Relationship between nodes
- HTML embedded in nodes.

View File

@@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="0.9.0"><node TEXT="This is the root node" STYLE="elipse" 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 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>

View File

@@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="0.9.0"><node TEXT="Fonts" STYLE="elipse" 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 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>

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="0.9.0"><node TEXT="Node Links" STYLE="elipse" 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 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>

View File

@@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><map version="0.9.0"><node TEXT="Shapes" STYLE="elipse" 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 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>