newton
Class NS

java.lang.Object
  |
  +--newton.NS

public class NS
extends Object

NS is an auxillary class for various convenience functions and necessities which don't fit elsewhere. Presently, NS allows you to get ahold of your Waba window and drawing area, grab protos from the ROM, and make common kinds of frame objects. It also contains a few functions useful in printing stuff to the screen or to the NTK inspector, for debugging purposes.


Field Summary
static int NEWTONTYPE
          What kind of Newton we have.
static int T_EMATE
          Emate 300
static int T_ERROR
          Error in Determining Type -- unlikely to happen!
static int T_MP120
          MessagePad 120
static int T_MP130
          MessagePad 130
static int T_MP2000
          MessagePad 2000, unupgraded
static int T_MP2100
          MessagePad 2100 or upgraded MessagePad 2000
static int T_OTHER
          Some other Weird Newton -- unlikely to happen!
static int VM
          The four-byte tag used to identify the C++ VM in memory (as opposed to other running VMs)
static int WINDOW
          The main window for our VM.
 
Constructor Summary
NS()
           
 
Method Summary
static Ref bounds(int left, int top, int right, int bottom)
          Returns a bounds rect.
static Ref frameWithProto(String symbol)
          Returns a Ref to a frame with its _proto slot set to the ROM proto requested by symbol name in the NOS Platform file.
static void notify(String title, String data)
          Pops up a notify dialog, useful for debugging.
static Ref object(int obj)
          Returns a Ref to the object requested.
static void print(Ref data)
          Prints a Ref to the NTK inspector, useful for debugging.
static void print(String data)
          Prints a String to the NTK inspector, useful for debugging.
static Ref proto(String symbol)
          Returns a Ref to the proto requested by symbol name in the NOS Platform file.
static int version()
          Returns the version number for this implementation of the Waba for the Newton VM
static Ref wabaDrawingArea()
          Returns a Ref to the Waba drawing area.
 
Methods inherited from class java.lang.Object
equals, hashCode, toString
 

Field Detail

VM

public static final int VM
The four-byte tag used to identify the C++ VM in memory (as opposed to other running VMs)

WINDOW

public static final int WINDOW
The main window for our VM. Presently a protoDragger. The actual drawing area (a clView) is a (typically 160x160) subview in this window which is stored in the slot wabaDrawingArea.

NEWTONTYPE

public static final int NEWTONTYPE
What kind of Newton we have. The return value of NS.object(NEWTONTYPE) is a NS integer whose value is one of the T_foo constants below.

T_MP2100

public static final int T_MP2100
MessagePad 2100 or upgraded MessagePad 2000

T_MP2000

public static final int T_MP2000
MessagePad 2000, unupgraded

T_EMATE

public static final int T_EMATE
Emate 300

T_MP130

public static final int T_MP130
MessagePad 130

T_MP120

public static final int T_MP120
MessagePad 120

T_ERROR

public static final int T_ERROR
Error in Determining Type -- unlikely to happen!

T_OTHER

public static final int T_OTHER
Some other Weird Newton -- unlikely to happen!
Constructor Detail

NS

public NS()
Method Detail

object

public static Ref object(int obj)
Returns a Ref to the object requested. Available objects are listed as static final ints in this class.

proto

public static Ref proto(String symbol)
Returns a Ref to the proto requested by symbol name in the NOS Platform file. Only protos are provided; it would be too expensive to have everything in the platform file stored in Waba for the Newton! You'll have to compute the rest.

wabaDrawingArea

public static Ref wabaDrawingArea()
Returns a Ref to the Waba drawing area.

frameWithProto

public static Ref frameWithProto(String symbol)
Returns a Ref to a frame with its _proto slot set to the ROM proto requested by symbol name in the NOS Platform file. A convenience function. Remember that this frame is merely a template, not a full view.

bounds

public static Ref bounds(int left,
                         int top,
                         int right,
                         int bottom)
Returns a bounds rect.

notify

public static void notify(String title,
                          String data)
Pops up a notify dialog, useful for debugging.

print

public static void print(String data)
Prints a String to the NTK inspector, useful for debugging.

print

public static void print(Ref data)
Prints a Ref to the NTK inspector, useful for debugging.

version

public static int version()
Returns the version number for this implementation of the Waba for the Newton VM