XPdfViewer.java :  » XML-UI » xui32 » com » xoetrope » swing » Java Open Source

Java Open Source » XML UI » xui32 
xui32 » com » xoetrope » swing » XPdfViewer.java
package com.xoetrope.swing;

//import com.adobe.acrobat.Viewer;
import java.awt.BorderLayout;
import javax.swing.JComponent;
import net.xoetrope.xui.XAttributedComponent;
import net.xoetrope.xui.XProjectManager;

/**
 * A Wrapper for the Adobe Acrobat PDF Viewer bean
 * @author Luan O'Carroll
 * <p> Copyright (c) Xoetrope Ltd., 2002-2006, This software is licensed under
 * the GNU Public License (GPL), please see license.txt for more details</p>
 */
public class XPdfViewer extends JComponent implements XAttributedComponent
{
//  Viewer viewer;
  
  /** Creates a new instance of XPdfViewer */
  public XPdfViewer() 
  {
    setLayout( new BorderLayout());
//    try  {
//      com.adobe.acrobat.gui.ReaderPrefs.initialize();
//      com.adobe.acrobat.gui.ReaderPrefs.readerPrefs.setProperty( "com.adobe.acrobat.AcceptedLicAgreement", "true" );
//      viewer = (Viewer)Class.forName( "com.adobe.acrobat.Viewer" ).newInstance();       
//      add( viewer, BorderLayout.CENTER );
//    } 
//    catch (Exception ex)
//    {
//      ex.printStackTrace();
//    }
  }  
  
  public int setAttribute( String attribName, Object attribValue )
  {
//    if ( attribName.equalsIgnoreCase( "content" )) {
//      try {
//        viewer.setDocumentURL( XProjectManager.getCurrentProject().findResource( attribValue.toString()).toExternalForm());
//        viewer.activate();
//        //viewer.activateWithoutBars();
//      } 
//      catch (Exception ex)
//      {
//        ex.printStackTrace();
//      }
//    }
    
    return 0;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.