int width, int height, String extras)
double width, double height, String extras)
	public OutputFormat(String filename,		int width, int height, String extras)		throws IOException, MapyrusException	{		int dotIndex;				/*		 * Determine the type of output to create from		 * filename suffix.		 */		dotIndex = filename.lastIndexOf('.');		if (dotIndex < 0)		{			/*			 * Use PNG format if there's no suffix.			 */			mFormatName = "PNG";		}		else		{			mFormatName = filename.substring(dotIndex + 1).toUpperCase();		}			/*		 * Are we writing a PostScript file or an image file?		 */		if (mFormatName.equals("PS") || mFormatName.equals("EPS"))		{			mOutputType = POSTSCRIPT;			mWriter = new PrintWriter(new BufferedWriter(new FileWriter(filename)));			writePostScriptHeader(width, height);		}		else		{			/*			 * Check that Java can write this image format to a file.			 */			boolean found = false;			String knownFormats[] = ImageIO.getWriterFormatNames();			for (int i = 0; i < knownFormats.length && found == false; i++)			{				if (mFormatName.equalsIgnoreCase(knownFormats[i]))				{					found = true;				}			}			if (found == false)			{				throw new MapyrusException("Cannot write image format: " + mFormatName);			}			/*			 * Create a BufferedImage to draw into.  We'll save it to a file			 * when user has finished drawing to it.			 */			mOutputType = IMAGE_FILE;			mImage = new BufferedImage(width, height,				BufferedImage.TYPE_3BYTE_BGR);			mGraphics2D = (Graphics2D)(mImage.getGraphics());			setupBufferedImage();		}		mOutputFile = new File(filename);	}