Skip to content

Commit bb8e7cb

Browse files
committed
improved example a bit
1 parent e405f59 commit bb8e7cb

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ Features:
1010

1111
Example usage:
1212

13-
EPSGraphics2D g = new EPSGraphics2D();
13+
Graphics2D g = new EPSGraphics2D();
1414
g.drawString("Hello World!", 0, 0);
15-
g.writeToFile(new File("helloworld.eps"));
15+
((EPSGraphics2D) g).writeToFile(new File("helloworld.eps"));
1616

1717

1818
Code license: [LGPLv3](http://www.gnu.org/copyleft/lesser.html)

src/net/matmas/epsgraphics/Main.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
package net.matmas.epsgraphics;
1818

19+
import java.awt.Graphics2D;
1920
import java.io.File;
2021
import java.io.FileNotFoundException;
2122

@@ -24,10 +25,10 @@
2425
* @author Martin Riesz <riesz.martin at gmail.com>
2526
*/
2627
public class Main {
27-
28-
public static void main(String[] args) throws FileNotFoundException {
29-
EPSGraphics2D g = new EPSGraphics2D();
30-
g.drawString("Hello World!", 0, 0);
31-
g.writeToFile(new File("helloworld.eps"));
32-
}
28+
public static void main(String[] args) throws FileNotFoundException {
29+
Graphics2D g = new EPSGraphics2D();
30+
g.drawString("Hello World!", 0, 0);
31+
32+
((EPSGraphics2D)g).writeToFile(new File("helloworld.eps"));
33+
}
3334
}

0 commit comments

Comments
 (0)