/** * First try to create a default font, but if that's not possible, throw * an exception that halts the program because textFont() has not been used * prior to the specified method. */ protected void defaultFontOrDeath(String method, float size) { if (parent != null) { textFont = parent.createDefaultFont(size); } else { throw new RuntimeException("Use textFont() before " + method + "()"); } }
/** * First try to create a default font, but if that's not possible, throw * an exception that halts the program because textFont() has not been used * prior to the specified method. */ protected void defaultFontOrDeath(String method, float size) { if (parent != null) { textFont = parent.createDefaultFont(size); } else { throw new RuntimeException("Use textFont() before " + method + "()"); } }