Skip to content

Commit

Permalink
Remove MD Parse Library
Browse files Browse the repository at this point in the history
The library which supported MD parsing to HTML has been removed due to it's dependency causing "class not found" error when packaged into a Jar file. Now using plain HTML.
  • Loading branch information
AvocadoMoon committed Feb 6, 2024
1 parent 6b5a2af commit dc31510
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 50 deletions.
6 changes: 0 additions & 6 deletions view-simulation-results/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,6 @@
<artifactId>jsoup</artifactId>
<version>1.16.1</version>
</dependency>

<dependency>
<groupId>org.commonmark</groupId>
<artifactId>commonmark</artifactId>
<version>0.20.0</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package org.vcell.N5.UI;

import org.commonmark.node.Node;
import org.commonmark.parser.Parser;
import org.commonmark.renderer.html.HtmlRenderer;

import com.google.common.io.CharStreams;

import javax.swing.*;
import java.awt.*;
import java.io.FileReader;
import java.io.IOException;
import java.io.*;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;

public class HelpExplanation {
private JDialog jDialog;
Expand All @@ -22,17 +18,14 @@ public HelpExplanation(){
JPanel helperPanel = new JPanel();
JTextPane textPane = new JTextPane();

Parser parser = Parser.builder().build();
String md;
URL mdPath = ClassLoader.getSystemClassLoader().getResource("Help.md");
String text;
try {
md = new String(Files.readAllBytes(Paths.get(mdPath.getPath())));
InputStream inputStream = ClassLoader.getSystemResourceAsStream("Help.html");
text = CharStreams.toString(new InputStreamReader(inputStream));
// text = new String(Files.readAllBytes(Paths.get(mdPath.getPath())));
} catch (IOException e) {
throw new RuntimeException(e);
}
Node node = parser.parse(md);
HtmlRenderer renderer = HtmlRenderer.builder().build();
String text = renderer.render(node);
textPane.setContentType("text/html");
textPane.setSize(width, height);
textPane.setPreferredSize(new Dimension(width, height));
Expand Down
39 changes: 39 additions & 0 deletions view-simulation-results/src/main/resources/Help.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<h3>Intro</h3>
<p>
The VCell (https://vcell.org/) application can export spatial simulation results into multiple formats, with
.N5 (https://imagej.net/libs/n5) being one of them. N5 exports are
stored remotely on VCell servers, allowing applications such as ImageJ
to directly access the results of these simulations and perform analyses.
</p>
<h3>VCell Spatial Simulation</h3>
<p>
Simulation solvers generating 2- or 3-dimensional spatial
domains can be visualized in ImageJ using this plugin.
Spatial dimensions and time directly correspond to fields within an ImageJ
image. The image's channels depict different variables within a simulation.
</p>
<h3>N5 and Datasets</h3>
<p>
Each N5 store is a direct mapping to a VCell simulation, and contains one or more
datasets. Each dataset holds numerical data and metadata corresponding to an Image in ImageJ.
Each N5 store is fully identified through its N5 URL which can be shared and opened by other applications
which support the N5 format.
</p>
<h3>Accessing Simulation Results</h3>
<p>For VCell exports generated from your local VCell installation:</p>
<ul>
<li>
<p>Either, Click the recent export button.</p>
</li>
<li>
<p>Or, Open the export table and view all past exports with their affiliated metadata.</p>
</li>
</ul>
<p>From N5 URL (VCell Install Not Required):</p>
<ul>
<li>Click the 'Remote Files' button, paste the N5 URL,
then select dataset from list.</li>
</ul>
</html>
30 changes: 0 additions & 30 deletions view-simulation-results/src/main/resources/Help.md

This file was deleted.

0 comments on commit dc31510

Please sign in to comment.