From: Michael T H. <mic...@us...> - 2003-06-03 11:13:29
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/g25d In directory sc8-pr-cvs1:/tmp/cvs-serv8198/src/org/openscience/jmol/g25d Added Files: Awt25D.java Swing25D.java Log Message: Explict support files for awt & swing --- NEW FILE: Awt25D.java --- /* $RCSfile: Awt25D.java,v $ * $Author: michaelthoward $ * $Date: 2003/06/03 11:13:25 $ * $Revision: 1.1 $ * * Copyright (C) 2003 The Jmol Development Team * * Contact: jmo...@li... * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package org.openscience.jmol.g25d; import java.awt.Component; import java.awt.Graphics; import java.awt.Image; final public class Awt25D { public static Image allocateImage(Component component, int width, int height) { return component.createImage(width, height); } public static Graphics createGraphics(Image image) { return (image == null) ? null : image.getGraphics(); } } --- NEW FILE: Swing25D.java --- /* $RCSfile: Swing25D.java,v $ * $Author: michaelthoward $ * $Date: 2003/06/03 11:13:25 $ * $Revision: 1.1 $ * * Copyright (C) 2003 The Jmol Development Team * * Contact: jmo...@li... * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ package org.openscience.jmol.g25d; import java.awt.Component; import java.awt.Graphics; import java.awt.Image; import java.awt.image.BufferedImage; final public class Swing25D { public static Image allocateImage(Component component, int width, int height) { return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); } public static Graphics createGraphics(Image image) { return (image == null) ? null : ((BufferedImage)image).createGraphics(); } } |