@Test public void testDoImport_OnlyRoot() throws Exception { final MindMap result = INSTANCE.makeFromLines(asList("\tSolar system ")); assertEquals("Solar system", result.getRoot().getText()); }
@Nonnull MindMap makeFromLines(@Nonnull @MustNotContainNull final List<String> lines) { final MindMap result = new MindMap(false); final Iterator<String> iterator = lines.iterator(); final List<TopicData> topicStack = new ArrayList<TopicData>(); while (true) { final Topic topic = decodeLine(result, iterator, topicStack); if (topic == null) { break; } } final Topic root = result.getRoot(); final int size = root == null ? 0 : root.getChildren().size(); if (root != null && size != 0) { final List<Topic> topics = root.getChildren(); final int left = (topics.size() + 1) / 2; for (int i = 0; i < left; i++) { AbstractCollapsableElement.makeTopicLeftSided(topics.get(i), true); } } return result; }
Text2MindMapImporter extends AbstractImporter { @Nonnull MindMap makeFromLines(@Nonnull @MustNotContainNull final List<String> lines) { final MindMap result = new MindMap(false); final Iterator<String> iterator = lines.iterator(); final List<TopicData> topicStack = new ArrayList<TopicData>(); while (true) { final Topic topic = decodeLine(result, iterator, topicStack); if (topic == null) { break; } } final Topic root = result.getRoot(); final int size = root == null ? 0 : root.getChildren().size(); if (root != null && size != 0) { final List<Topic> topics = root.getChildren(); final int left = (topics.size() + 1) / 2; for (int i = 0; i < left; i++) { AbstractCollapsableElement.makeTopicLeftSided(topics.get(i), true); } } return result; } }
Text2MindMapImporter extends AbstractImporter { @Nonnull MindMap makeFromLines(@Nonnull @MustNotContainNull final List<String> lines) { final MindMap result = new MindMap(false); final Iterator<String> iterator = lines.iterator(); final List<TopicData> topicStack = new ArrayList<TopicData>(); while (true) { final Topic topic = decodeLine(result, iterator, topicStack); if (topic == null) { break; } } final Topic root = result.getRoot(); final int size = root == null ? 0 : root.getChildren().size(); if (root != null && size != 0) { final List<Topic> topics = root.getChildren(); final int left = (topics.size() + 1) / 2; for (int i = 0; i < left; i++) { AbstractCollapsableElement.makeTopicLeftSided(topics.get(i), true); } } return result; }  }
Text2MindMapImporter extends AbstractImporter { @Nonnull MindMap makeFromLines(@Nonnull @MustNotContainNull final List<String> lines) { final MindMap result = new MindMap(false); final Iterator<String> iterator = lines.iterator(); final List<TopicData> topicStack = new ArrayList<TopicData>(); while (true) { final Topic topic = decodeLine(result, iterator, topicStack); if (topic == null) { break; } } final Topic root = result.getRoot(); final int size = root == null ? 0 : root.getChildren().size(); if (root != null && size != 0) { final List<Topic> topics = root.getChildren(); final int left = (topics.size() + 1) / 2; for (int i = 0; i < left; i++) { AbstractCollapsableElement.makeTopicLeftSided(topics.get(i), true); } } return result; }  @Override @Nullable MindMap doImport(@Nonnull final PluginContext context); @Override @Nullable String getMnemonic(); @Override @Nonnull String getName(@Nonnull final PluginContext context); @Override @Nonnull String getReference(@Nonnull final PluginContext context); @Override @Nonnull Icon getIcon(@Nonnull final PluginContext context); @Override int getOrder(); }
Text2MindMapImporter extends AbstractImporter { @Nonnull MindMap makeFromLines(@Nonnull @MustNotContainNull final List<String> lines) { final MindMap result = new MindMap(false); final Iterator<String> iterator = lines.iterator(); final List<TopicData> topicStack = new ArrayList<TopicData>(); while (true) { final Topic topic = decodeLine(result, iterator, topicStack); if (topic == null) { break; } } final Topic root = result.getRoot(); final int size = root == null ? 0 : root.getChildren().size(); if (root != null && size != 0) { final List<Topic> topics = root.getChildren(); final int left = (topics.size() + 1) / 2; for (int i = 0; i < left; i++) { AbstractCollapsableElement.makeTopicLeftSided(topics.get(i), true); } } return result; }  @Override @Nullable MindMap doImport(@Nonnull final PluginContext context); @Override @Nullable String getMnemonic(); @Override @Nonnull String getName(@Nonnull final PluginContext context); @Override @Nonnull String getReference(@Nonnull final PluginContext context); @Override @Nonnull Icon getIcon(@Nonnull final PluginContext context); @Override int getOrder();  }