01: package com.xoetrope.swing;
02:
03: import java.net.MalformedURLException;
04: import java.net.URL;
05: import javax.swing.SwingUtilities;
06: import net.xoetrope.xui.XAttributedComponent;
07: import net.xoetrope.xui.XProject;
08: import net.xoetrope.xui.XProjectManager;
09:
10: //import org.xhtmlrenderer.extend.TextRenderer;
11: //import org.xhtmlrenderer.layout.SharedContext;
12: //import org.xhtmlrenderer.render.Java2DTextRenderer;
13: //import org.xhtmlrenderer.simple.FSScrollPane;
14: //import org.xhtmlrenderer.simple.XHTMLPanel;
15:
16: /**
17: *
18: * @author Luan O'Carroll
19: * <p> Copyright (c) Xoetrope Ltd., 2002-2006, This software is licensed under
20: * the GNU Public License (GPL), please see license.txt for more details</p>
21: */
22: public class XHtmlPanelHolder //extends FSScrollPane implements XAttributedComponent
23: {
24: // private XHTMLPanel panel;
25: // private XProject currentProject;
26: //
27: // /**
28: // * Creates a new instance of XHtmlPanelHolder
29: // */
30: // public XHtmlPanelHolder()
31: // {
32: // super( new XHTMLPanel());
33: // currentProject = XProjectManager.getCurrentProject();
34: //
35: // panel = (XHTMLPanel)getViewport().getComponent( 0 );
36: //
37: // SharedContext sharedContext = panel.getSharedContext();
38: // sharedContext.setTextRenderer( new Java2DTextRenderer());
39: // sharedContext.getTextRenderer().setSmoothingLevel( TextRenderer.HIGH );
40: // }
41: //
42: // /**
43: // * Set one or more attributes of the component.
44: // * @param attribName the name of the attribute
45: // * @param attribValue the value of the attribute
46: // * @return 0 for success, non zero for failure or to require some further action
47: // */
48: // public int setAttribute( String attribName, Object attribValue )
49: // {
50: // if ( attribName.toLowerCase().equals( "content" )) {
51: // final String attrib = (String)attribValue;
52: // SwingUtilities.invokeLater( new Runnable()
53: // {
54: // public void run()
55: // {
56: // try {
57: // URL url = new URL( attrib );
58: // if ( url != null ) {
59: // String urls = url.toExternalForm();
60: // panel.setDocument( urls );
61: // }
62: // }
63: // catch ( MalformedURLException ex )
64: // {
65: // ex.printStackTrace();
66: // }
67: // }
68: // });
69: // }
70: // return 0;
71: // }
72: }
|