summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoreteq <[email protected]>2007-04-03 04:23:12 +0000
committereteq <[email protected]>2007-04-03 04:23:12 +0000
commit4eec1bd0b554dfb3fdfac67969d6e9c181bb81c0 (patch)
tree276d819f6c72e75a1e42ce35a5c248722e79c47e /src
parentd31a93e255019a5dc177a1caf91da174bd313b82 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/net/java/joglutils/jogltext/FontDrawer.java11
1 files 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;
}