Package org.boco.seamwebappgen.gui

Source Code of org.boco.seamwebappgen.gui.LogoCanvas

/***************************************************************************
*  Copyright (c) 2004 - 2008  Fabrizio Boco fabboco@users.sourceforge.net *
*                                                                         *
*                                                                         *
*   This is free software; you can redistribute it and/or                 *
*   modify it under the terms of the GNU Library General Public           *
*   License (version 2.1) as published by the Free Software Foundation    *
*                                                                         *
*   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 Library General Public License for more details.                  *
*                                                                         *
*   You should have received a copy of the GNU Library General Public     *
*   License along with this library; see the file COPYING.LIB. If not,    *
*   write to the Free Software Foundation, Inc., 59 Temple Place,         *
*   Suite 330, Boston, MA  02111-1307, USA                                *
*                                                                         *
***************************************************************************/
/**
- $Header: /usr/local/cvslocalrepository/SeamWebAppGenerator/src/org/boco/seamwebappgen/gui/Attic/LogoCanvas.java,v 1.1.2.3 2008/04/22 05:37:57 fab Exp $
- $Author: fab $
- $Revision: 1.1.2.3 $
- $Date: 2008/04/22 05:37:57 $
- $Log: LogoCanvas.java,v $
- Revision 1.1.2.3  2008/04/22 05:37:57  fab
- Aggiornamento indirizzo di posta
-
- Revision 1.1.2.2  2008/04/19 13:28:43  fab
- Modifiche varie per rafactoring
-
- Revision 1.1.2.1  2008/04/19 13:12:49  fab
- Modifiche varie per rafactoring
-
- Revision 1.1.2.1  2008/04/19 11:18:31  fab
- Refactoring
-
- Revision 1.1.2.3  2008/04/19 10:07:02  fab
- Aggiornamento riferimenti licenza
-
-
**/
package org.boco.seamwebappgen.gui;

import java.awt.Canvas;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.MediaTracker;
import java.awt.Toolkit;
import java.awt.image.ImageProducer;
import java.io.IOException;
import java.net.URL;

/**
*
* @author Fabrizio Boco
*
*/
public class LogoCanvas extends Canvas
{
   private static final long serialVersionUID = 1L;
  private Image  image;

  public LogoCanvas()
  {
    MediaTracker media = new MediaTracker(this);
   
    java.io.File myPic = new java.io.File("src/org/boco/seamwebappgen/gui/SeamWebAppGen_64x64.gif");

//    System.out.println("File exists: " + myPic.exists());
//    System.out.println(System.getProperty("user.dir"));
   
    if (myPic.exists())
    {
      image = Toolkit.getDefaultToolkit().getImage("src/org/boco/seamwebappgen/gui/SeamWebAppGen_64x64.gif");
     
    }
    else
    {
      image = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("/org/boco/seamwebappgen/gui/SeamWebAppGen_64x64.gif"));
    }
       
    media.addImage(image, 0);
   
    try
    {
      media.waitForID(0);
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }

  public LogoCanvas(ImageProducer imageProducer)
  {
    image = createImage(imageProducer);
  }
 

  @Override
  public void paint(Graphics g)
  {
    g.drawImage(image, 0,0, this);
  }

}
TOP

Related Classes of org.boco.seamwebappgen.gui.LogoCanvas

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.