Revision 3183 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrame.java

View differences:

FFrame.java
52 52
import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
53 53
import com.iver.cit.gvsig.gui.layout.Layout;
54 54
import com.iver.cit.gvsig.gui.layout.dialogs.Tag;
55
import com.iver.cit.gvsig.gui.project.OpenException;
55 56
import com.iver.cit.gvsig.project.Project;
56 57

  
57 58
import com.iver.utiles.XMLEntity;
......
563 564
     *
564 565
     * @return Objeto de esta clase.
565 566
     */
566
    public static IFFrame createFFrame(XMLEntity xml, Project p) {
567
        IFFrame fframe = null;
568

  
569
        try {
570
            Class clase = Class.forName(xml.getStringProperty("className"));
571
            fframe = (IFFrame) clase.newInstance();
572
        } catch (Exception e) {
573
            NotificationManager.addError("Clase de Frame sobre el Layout no reconocida",
574
                e);
575
        }
576

  
567
    public static IFFrame createFFrame(XMLEntity xml, Project p) throws OpenException {
568
    	IFFrame fframe = null;
569
    	String className="IFFrame";
570
    	    Class clase=null;
571
			try {
572
				className=xml.getStringProperty("className");
573
				clase = Class.forName(className);
574
			} catch (ClassNotFoundException e) {
575
				NotificationManager.addError("Clase de Frame sobre el Layout no reconocida",e);
576
			}
577
            try {
578
				fframe = (IFFrame) clase.newInstance();
579
			} catch (InstantiationException e) {
580
				NotificationManager.addError("Fallo creando el Frame: "+clase.getName(),e);
581
			} catch (IllegalAccessException e) {
582
				NotificationManager.addError("Fallo creando el Frame: "+clase.getName(),e);
583
			}
584
          
585
       try{
577 586
        if (fframe instanceof IFFrameUseProject) {
578 587
            ((IFFrameUseProject) fframe).setProject(p);
579 588
        }
......
589 598
                xml.getDoubleProperty("y"), xml.getDoubleProperty("w"),
590 599
                xml.getDoubleProperty("h")));
591 600
        fframe.setTag(xml.getStringProperty("tag"));
592

  
593
        return fframe;
601
       }catch (Exception e) {
602
		throw new OpenException(e,className);
603
	}
604
    	return fframe;
594 605
    }
595 606

  
596 607
    /**

Also available in: Unified diff