Clover coverage report - AdWT - 1.0.0
Coverage timestamp: sam. déc. 27 2003 15:14:10 CET
file stats: LOC: 94   Methods: 5
NCLOC: 45   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
SDIFrameServiceProvider.java - 0% 0% 0%
coverage
 1   
 /*
 2   
  * EJTools, the Enterprise Java Tools
 3   
  *
 4   
  * Distributable under LGPL license.
 5   
  * See terms of license at www.gnu.org.
 6   
  */
 7   
 package org.ejtools.adwt.service;
 8   
 
 9   
 import java.awt.BorderLayout;
 10   
 import java.awt.Container;
 11   
 import java.awt.Dimension;
 12   
 import java.awt.Toolkit;
 13   
 import java.beans.beancontext.BeanContextServices;
 14   
 
 15   
 import javax.swing.JPanel;
 16   
 import javax.swing.WindowConstants;
 17   
 
 18   
 import org.apache.log4j.Logger;
 19   
 
 20   
 /**
 21   
  * Description of the Class
 22   
  *
 23   
  * @author    Laurent Etiemble
 24   
  * @version   $Revision: 1.5 $
 25   
  * @todo      Javadoc to complete
 26   
  */
 27   
 public class SDIFrameServiceProvider extends FrameServiceProvider implements SDIFrameService
 28   
 {
 29   
    /** Description of the Field */
 30   
    protected Container content = new JPanel();
 31   
    /** Description of the Field */
 32   
    private static Logger logger = Logger.getLogger(SDIFrameServiceProvider.class);
 33   
 
 34   
 
 35   
    /** Constructor for the FrameServiceProvider object */
 36  0
    public SDIFrameServiceProvider()
 37   
    {
 38  0
       super();
 39   
    }
 40   
 
 41   
 
 42   
    /**
 43   
     * Sets the content attribute of the FrameServiceProvider object
 44   
     *
 45   
     * @param c  The new content value
 46   
     */
 47  0
    public void setContent(Container c)
 48   
    {
 49  0
       this.content = c;
 50   
    }
 51   
 
 52   
 
 53   
    /**
 54   
     * @return   The serviceClass value
 55   
     */
 56  0
    protected Class[] getServiceClass()
 57   
    {
 58  0
       return new Class[]{FrameService.class, SDIFrameService.class};
 59   
    }
 60   
 
 61   
 
 62   
    /** Description of the Method */
 63  0
    protected void initializeBeanContextResources()
 64   
    {
 65  0
       super.initializeBeanContextResources();
 66   
 
 67  0
       BeanContextServices context = (BeanContextServices) getBeanContext();
 68   
 
 69  0
       frame.setSize(new Dimension(700, 500));
 70   
 
 71  0
       this.scrollPane.getViewport().add(content);
 72  0
       this.frame.getContentPane().add(BorderLayout.CENTER, scrollPane);
 73   
 
 74  0
       Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
 75  0
       this.frame.setLocation(screen.width / 2 - frame.getSize().width / 2, screen.height / 2 - frame.getSize().height / 2);
 76  0
       this.frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
 77   
 
 78  0
       this.useServices(context);
 79  0
       this.frame.setVisible(true);
 80   
 
 81  0
       logger.debug("SDIFrameService added");
 82   
    }
 83   
 
 84   
 
 85   
    /** */
 86  0
    protected void releaseBeanContextResources()
 87   
    {
 88  0
       super.releaseBeanContextResources();
 89   
 
 90  0
       logger.debug("SDIFrameService removed");
 91   
    }
 92   
 }
 93   
 
 94