package morepaste.app; import java.awt.*; import java.io.Serializable; import javax.swing.*; import morepaste.plugin.*; import morepaste.util.DropAccepter; /** * @version 1.1.0 2002-03-21 * @author Takashi KOBAYASHI * @see morepaste.plugin */ public class SplashPlugin extends AbstractBasicPlugin implements Serializable, Droppable { private final String theTitle = "About..."; private final String imgfile = "morepaste/MPSplash.jpg"; private ImageIcon splash; public SplashPlugin() { title = theTitle; createUI(); } public String doCommand( String in ) { return in; } private DropAccepter accepter; public void setDropAccepter( DropAccepter accepter ) { this.accepter = accepter; } private void createUI() { splash = new ImageIcon( getClass().getClassLoader().getResource( imgfile ) ); cont = new JPanel() { public void paint( Graphics g ) { splash.paintIcon( this, g, (this.getWidth() - splash.getImage().getWidth( this ))/2, (this.getHeight() - splash.getImage().getHeight( this ))/2 ); } public Dimension getPreferredSize() { return new Dimension( splash.getImage().getWidth( this ), splash.getImage().getHeight( this ) ); } }; } }