Skip to content

Commit

Permalink
release of 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
hageldave committed Jul 4, 2019
1 parent 8eb61c7 commit 8f42cb3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ JPlotter is available as Maven artifact at the Central Maven Repository.
<dependency>
<groupId>com.github.hageldave.jplotter</groupId>
<artifactId>jplotter</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>
</dependency>
```

Expand Down Expand Up @@ -133,6 +133,25 @@ SwingUtilities.invokeLater(()->{
frame.setVisible(true);
});
```
We can also add a pop up menu for exporting to SVG.
```java
PopupMenu menu = new PopupMenu();
canvas.add(menu);
MenuItem svgExport = new MenuItem("SVG export");
menu.add(svgExport);
svgExport.addActionListener(e->{
Document svg = SVGUtils.containerToSVG(frame.getContentPane());
SVGUtils.documentToXMLFile(svg, new File("example_export.svg"));
System.out.println("exported SVG.");
});
canvas.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if(SwingUtilities.isRightMouseButton(e))
menu.show(canvas, e.getX(), e.getY());
}
});
```
![Example Viz](https://raw.githubusercontent.com/wiki/hageldave/JPlotter/images/example_viz.png)

*[```Source```](https://github.com/hageldave/JPlotter/blob/master/jplotter/src/test/java/hageldave/jplotter/Example.java)*
2 changes: 1 addition & 1 deletion jplotter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.github.hageldave.jplotter</groupId>
<artifactId>jplotter</artifactId>
<version>0.1.2-SNAPSHOT</version>
<version>0.1.2</version>

<name>JPlotter</name>
<url>https://github.com/hageldave/JPlotter</url>
Expand Down

0 comments on commit 8f42cb3

Please sign in to comment.