|
From: Elias N. <eli...@us...> - 2004-03-27 14:57:04
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31555/src/java/org/lwjgl Modified Files: Display.java SwingAdapter.java Added Files: LWJGLErrorException.java Log Message: Added LWJGLErrorException to replace the too general Exception Index: SwingAdapter.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/SwingAdapter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SwingAdapter.java 7 Mar 2004 15:20:28 -0000 1.1 +++ SwingAdapter.java 27 Mar 2004 14:42:45 -0000 1.2 @@ -52,7 +52,7 @@ */ SwingAdapter() { } - + /** * Spawn a "modal" dialog in the centre of the screen with a message in it * and an OK button. This method blocks until the dialog is dismissed. @@ -60,10 +60,10 @@ * @param message Message to show in alert */ public void alert(String title, String message) { - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch(Exception e) { - } - JOptionPane.showMessageDialog(null, message, title, JOptionPane.WARNING_MESSAGE); + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch(Exception e) { + } + JOptionPane.showMessageDialog(null, message, title, JOptionPane.WARNING_MESSAGE); } } --- NEW FILE: LWJGLErrorException.java --- package org.lwjgl; public class LWJGLErrorException extends Exception { public LWJGLErrorException(String msg) { super(msg); } } Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- Display.java 27 Mar 2004 13:48:57 -0000 1.42 +++ Display.java 27 Mar 2004 14:42:45 -0000 1.43 @@ -131,9 +131,9 @@ * still need to query the display's characteristics using getDisplayMode(). * * @param mode The new display mode to set - * @throws Exception if the display mode could not be set + * @throws LWJGLErrorException if the display mode could not be set */ - public static native void setDisplayMode(DisplayMode mode) throws Exception; + public static native void setDisplayMode(DisplayMode mode) throws LWJGLErrorException; /** * Reset the display mode to whatever it was when LWJGL was initialized. @@ -195,14 +195,14 @@ * @param brightness The brightness value between -1.0 and 1.0, inclusive * @param contrast The contrast, larger than 0.0. */ - public static void setDisplayConfiguration(float gamma, float brightness, float contrast) throws Exception { + public static void setDisplayConfiguration(float gamma, float brightness, float contrast) throws LWJGLErrorException { if (brightness < -1.0f || brightness > 1.0f) throw new IllegalArgumentException("Invalid brightness value"); if (contrast < 0.0f) throw new IllegalArgumentException("Invalid contrast value"); int rampSize = getGammaRampLength(); if (rampSize == 0) { - throw new Exception("Display configuration not supported"); + throw new LWJGLErrorException("Display configuration not supported"); } FloatBuffer gammaRamp = ByteBuffer.allocateDirect(rampSize*4).order(ByteOrder.nativeOrder()).asFloatBuffer(); for (int i = 0; i < rampSize; i++) { @@ -235,7 +235,7 @@ /** * Native method to set the gamma ramp. */ - private static native void setGammaRamp(FloatBuffer gammaRamp) throws Exception ; + private static native void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLErrorException; /** * Get the driver adapter string. This is a unique string describing the actual card's hardware, eg. "Geforce2", "PS2", |