mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-21 21:57:56 +01:00
fix vertical order when export to freemind versions.
This commit is contained in:
parent
26a18ae7d0
commit
2a121f91d2
@ -42,6 +42,7 @@ import java.io.OutputStream;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -136,6 +137,7 @@ public class FreemindExporter
|
||||
private void addNodeFromTopic(@NotNull final TopicType mainTopic, @NotNull final Node destNode) throws IOException, SAXException, ParserConfigurationException {
|
||||
final List<TopicType> currentTopic = mainTopic.getTopic();
|
||||
|
||||
Collections.sort(currentTopic, new VerticalPositionComparator());
|
||||
for (TopicType topicType : currentTopic) {
|
||||
final Node newNode = objectFactory.createNode();
|
||||
nodesMap.put(topicType.getId(), newNode);
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.wisemapping.exporter;
|
||||
|
||||
import com.wisemapping.jaxb.wisemap.TopicType;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
public class VerticalPositionComparator implements Comparator<TopicType> {
|
||||
|
||||
@Override
|
||||
public int compare(TopicType o1, TopicType o2) {
|
||||
final String myPosition = o1.getPosition();
|
||||
final String otherPosition = o2.getPosition();
|
||||
int myPositionY = Integer.parseInt(myPosition.split(",")[1]);
|
||||
int otherPositionY = Integer.parseInt(otherPosition.split(",")[1]);
|
||||
return myPositionY - otherPositionY;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user