From 4eec1bd0b554dfb3fdfac67969d6e9c181bb81c0 Mon Sep 17 00:00:00 2001 From: eteq Date: Tue, 3 Apr 2007 04:23:12 +0000 Subject: minor error-checking changes git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/joglutils/trunk@56 83d24430-9974-4f80-8418-2cc3294053b9 --- src/net/java/joglutils/jogltext/FontDrawer.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/net/java/joglutils/jogltext/FontDrawer.java b/src/net/java/joglutils/jogltext/FontDrawer.java index 1bf148b..faaac43 100644 --- a/src/net/java/joglutils/jogltext/FontDrawer.java +++ b/src/net/java/joglutils/jogltext/FontDrawer.java @@ -62,9 +62,13 @@ public class FontDrawer { /** * Intstantiates a new FontDrawer initially rendering in the specified font. + * * @param font the initial font for this FontDrawer + * @throws java.lang.NullPointerException if the supplied font is null */ - public FontDrawer(Font font) { + public FontDrawer(Font font) throws NullPointerException { + if (font == null) + throw new NullPointerException("Can't use a null font to create a FontDrawer"); this.font = font; depth = 0; edgeOnly = false; @@ -74,8 +78,11 @@ public class FontDrawer { /** * Specifies which font to render with this FontDrawer * @param font a font to use for rendering + ** @throws java.lang.NullPointerException if the supplied font is null */ - public void setFont(Font font) { + public void setFont(Font font) throws NullPointerException { + if (font == null) + throw new NullPointerException("Can't set a FontDrawer font to null"); this.font = font; } -- cgit v1.2.3