waba.applet
Class JavaBridge

java.lang.Object
  |
  +--waba.applet.JavaBridge

public final class JavaBridge
extends java.lang.Object

This class was created to implement all methods of Sun's JDK and thus making easier to port this package to other java platforms

Most of these methods are for internal use only. The only methods/members that may be called are:

 setNonGUIApp
 resetNonGUIApp
 showMsgs
 
Never call the other methods directly!


Field Summary
static java.util.Hashtable htOpenedAt
           
static int scale
          show 1:1, doubled, 3x or 4x
static boolean showMsgs
          set to false if you're deploying your JDK application, to hide the warning messages.
 
Constructor Summary
JavaBridge()
           
 
Method Summary
static void beep()
          called by waba.fx.Sound.beep and Sound.tone
static void fillSettings()
          called by waba.applet.Applet.init()
static void fillTime(Time t)
          called by waba.sys.Time constructor
static java.awt.Color getColor(int color)
          gets the awt color from the SuperWaba color
static java.lang.String getDataPath()
           
static java.lang.String getDefaultCrid(java.lang.String name)
           
static UserFont getFont(Font f)
           
static UserFont getFontMetrics(Font f)
          called by FontMetrics
static long getTime()
          called by methods in the waba.io.Catalog class
static void GraphicsLine(ISurface surface, int x1, int y1, int x2, int y2, int color)
           
static boolean isOk(java.lang.String s)
          return true is the string is valid. called by openInputStream and openOutputStream in this class.
static java.io.InputStream openInputStream(java.lang.String path)
          used in some classes so they can correctly open files. now can open jar files.
static java.io.OutputStream openOutputStream(java.lang.String path)
          used in some classes so they can correctly open files. used internally by readBytes.
static void print(java.lang.String s)
          Calls System.out.println.
static byte[] readBytes(java.lang.String path)
          read the available bytes from the stream getted with openInputStream. called by waba.fx.Image and waba.io.Catalog
static void resetNonGUIApp()
          After creating the pdb, if you want to use the gui classes, you must call this method.
static void setNonGUIApp()
          IMPORTANT!!!
static void storeSettings()
           
static boolean writeBytes(java.lang.String path, byte[] buf, int len)
          write the available bytes to the stream getted with openOutputStream. called by waba.io.Catalog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

showMsgs

public static boolean showMsgs
set to false if you're deploying your JDK application, to hide the warning messages. USE THIS WITH CAUTION, because any errors that the VM would warn, you will miss, and this may lead to real crashes in the device.

scale

public static int scale
show 1:1, doubled, 3x or 4x

htOpenedAt

public static java.util.Hashtable htOpenedAt
Constructor Detail

JavaBridge

public JavaBridge()
Method Detail

setNonGUIApp

public static void setNonGUIApp()
IMPORTANT!!! To create an app just to read or write a pdb file, without a Graphical User Interface, you must call this method.

resetNonGUIApp

public static void resetNonGUIApp()
After creating the pdb, if you want to use the gui classes, you must call this method.

print

public static void print(java.lang.String s)
Calls System.out.println. Superwaba system debugging uses this method. See also debug(String s).

getFont

public static UserFont getFont(Font f)

getFontMetrics

public static UserFont getFontMetrics(Font f)
called by FontMetrics

GraphicsLine

public static void GraphicsLine(ISurface surface,
                                int x1,
                                int y1,
                                int x2,
                                int y2,
                                int color)

getColor

public static java.awt.Color getColor(int color)
gets the awt color from the SuperWaba color

getDataPath

public static java.lang.String getDataPath()

openInputStream

public static java.io.InputStream openInputStream(java.lang.String path)
used in some classes so they can correctly open files. now can open jar files.

openOutputStream

public static java.io.OutputStream openOutputStream(java.lang.String path)
used in some classes so they can correctly open files. used internally by readBytes.

readBytes

public static byte[] readBytes(java.lang.String path)
read the available bytes from the stream getted with openInputStream. called by waba.fx.Image and waba.io.Catalog

writeBytes

public static boolean writeBytes(java.lang.String path,
                                 byte[] buf,
                                 int len)
write the available bytes to the stream getted with openOutputStream. called by waba.io.Catalog

beep

public static void beep()
called by waba.fx.Sound.beep and Sound.tone

isOk

public static boolean isOk(java.lang.String s)
return true is the string is valid. called by openInputStream and openOutputStream in this class.

getTime

public static long getTime()
called by methods in the waba.io.Catalog class

fillTime

public static void fillTime(Time t)
called by waba.sys.Time constructor

getDefaultCrid

public static java.lang.String getDefaultCrid(java.lang.String name)

storeSettings

public static void storeSettings()

fillSettings

public static void fillSettings()
called by waba.applet.Applet.init()