org.faceless.pdf2
Class JSCoreMethods

java.lang.Object
  extended by org.faceless.pdf2.JSCoreMethods

public class JSCoreMethods
extends Object

This class contains various methods which are called from JavaScript. An instance of this class is bound to the "__bfo" global object in the JavaScript environment and it serves as the interface between the two environments. This implementation has no-ops for many methods (eg appAlert), but a subclass can override them to provide useful implementations, say by bringing up an AWT Dialog.

Since:
2.9

Constructor Summary
JSCoreMethods()
           
 
Method Summary
 void AFDate_FormatEx(JSEvent event, String format)
          An implementation of the AFDate_Format JavaScript method
 void AFNumber_Format(JSEvent event, int dec, int sep, int neg, int dummy, String cursym, boolean curfirst)
          An implementation of the AFNumber_Format JavaScript method
 void AFPercent_Format(JSEvent event, int dec, int sep)
          An implementation of the AFPercent_Format JavaScript method
 void AFSpecial_Format(JSEvent event, int psf)
          An implementation of the AFSpecial_Format JavaScript method
 Object[] appActiveDocs()
          An implementation of the App.activeDocs JavaScript property
 int appAlert(String message, int nIcon, int nType, String cTitle, Object oDoc, Object oCheckbox)
          An implementation of the App.alert() JavaScript method
 void appBeep()
          An implementation of the App.beep() JavaScript method
 String appResponse(String message, String cTitle, String cDefault, boolean bPassword, String cLabel)
          An implementation of the App.response() JavaScript method
 String appViewerType()
          An implementation of the App.viewerType() JavaScript property
 String appViewerVariation()
          An implementation of the App.viewerVariation() JavaScript property
 int appViewerVersion()
          An implementation of the App.viewerVersion() JavaScript property
 Object[] colorFromAWT(Paint paint)
          Convert an AWT Color to a PDF color
 Color colorToAWT(Object[] pdfcolor)
          Convert a PDF Color to an AWT color
 void consoleClear()
          An implementation of the Console.clear() JavaScript method.
 void consoleHide()
          An implementation of the Console.hide() JavaScript method.
 void consolePrintln(String s)
          An implementation of the Console.println() JavaScript method.
 void consoleShow()
          An implementation of the Console.show() JavaScript method.
 String getCustomAppInitScript()
          Return an additional Script to be run on the App/Init event.
 String getCustomDocOpenScript()
          Return an additional Script to be run on the Doc/Open event, before any Scripts defined by PDF.getJavaScript().
 String getCustomDocWillCloseScript()
          Return an additional Script to be run on the Doc/WillClose event, after any Scripts defined by PDF.getAction(Event.CLOSE).
 void notifyForRedraw(Object o)
          Called when a PDF object has had it's state changed and needs to be rebuilt
 void reportThrowable(Throwable e)
          Print a Throwable to the Console
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSCoreMethods

public JSCoreMethods()
Method Detail

getCustomAppInitScript

public String getCustomAppInitScript()
Return an additional Script to be run on the App/Init event. The default implementation returns null, which means no extra JavaScript is run.


getCustomDocOpenScript

public String getCustomDocOpenScript()
Return an additional Script to be run on the Doc/Open event, before any Scripts defined by PDF.getJavaScript(). The default implementation returns null, which means no extra JavaScript is run.


getCustomDocWillCloseScript

public String getCustomDocWillCloseScript()
Return an additional Script to be run on the Doc/WillClose event, after any Scripts defined by PDF.getAction(Event.CLOSE). The default implementation returns null, which means no extra JavaScript is run.


reportThrowable

public void reportThrowable(Throwable e)
Print a Throwable to the Console


AFNumber_Format

public final void AFNumber_Format(JSEvent event,
                                  int dec,
                                  int sep,
                                  int neg,
                                  int dummy,
                                  String cursym,
                                  boolean curfirst)
An implementation of the AFNumber_Format JavaScript method


AFPercent_Format

public final void AFPercent_Format(JSEvent event,
                                   int dec,
                                   int sep)
An implementation of the AFPercent_Format JavaScript method


AFSpecial_Format

public final void AFSpecial_Format(JSEvent event,
                                   int psf)
An implementation of the AFSpecial_Format JavaScript method


AFDate_FormatEx

public final void AFDate_FormatEx(JSEvent event,
                                  String format)
An implementation of the AFDate_Format JavaScript method


notifyForRedraw

public void notifyForRedraw(Object o)
Called when a PDF object has had it's state changed and needs to be rebuilt


appActiveDocs

public final Object[] appActiveDocs()
An implementation of the App.activeDocs JavaScript property


colorFromAWT

public final Object[] colorFromAWT(Paint paint)
Convert an AWT Color to a PDF color


colorToAWT

public final Color colorToAWT(Object[] pdfcolor)
Convert a PDF Color to an AWT color


appBeep

public void appBeep()
An implementation of the App.beep() JavaScript method


appAlert

public int appAlert(String message,
                    int nIcon,
                    int nType,
                    String cTitle,
                    Object oDoc,
                    Object oCheckbox)
An implementation of the App.alert() JavaScript method


appResponse

public String appResponse(String message,
                          String cTitle,
                          String cDefault,
                          boolean bPassword,
                          String cLabel)
An implementation of the App.response() JavaScript method


appViewerType

public String appViewerType()
An implementation of the App.viewerType() JavaScript property


appViewerVariation

public String appViewerVariation()
An implementation of the App.viewerVariation() JavaScript property


appViewerVersion

public int appViewerVersion()
An implementation of the App.viewerVersion() JavaScript property


consoleShow

public void consoleShow()
An implementation of the Console.show() JavaScript method. The default implementation of this method turns on console.println(), so output goes to System.out


consoleHide

public void consoleHide()
An implementation of the Console.hide() JavaScript method. The default implementation of this method turns off console.println();


consoleClear

public void consoleClear()
An implementation of the Console.clear() JavaScript method.


consolePrintln

public void consolePrintln(String s)
An implementation of the Console.println() JavaScript method. The default implementation does nothiing unless console.show() has been called.



Copyright © 2001-2004 Big Faceless Organization