ApplicationModel.st
changeset 78 a708779d798c
parent 72 ba662a33428d
child 81 7957a41f7ead
--- a/ApplicationModel.st	Fri May 19 18:40:45 1995 +0200
+++ b/ApplicationModel.st	Tue Jun 06 06:04:53 1995 +0200
@@ -39,7 +39,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.8 1995-05-12 17:59:33 claus Exp $
+$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.9 1995-06-06 04:04:53 claus Exp $
 "
 !
 
@@ -52,7 +52,23 @@
     compatible to the corresponding ST80 class; therefore, manual
     changes have to be made to get those applications to run under ST/X.
     (but at least, this enables you to fileIn that code and have a superclass
-    for them)
+     for them)
+
+    As time goes by, ST/X applications are going to be converted to
+    become subclasses of this abstract class - see NewLauncher for a
+    first concrete example.
+
+    ApplicationModel is prepared to build a view from a windowSpec, as
+    created by the windowBuilder. If you subclass does not provide such
+    a spec, you should at least redefine:
+
+	openInterface   - to create a topview and open it
+
+    you may want to redefine:
+
+	closeRequest    - to catch window closing
+	focusSequence   - to define a sequence for focus-stepping
+
 
     The classResources have been put into this class to allow ST/X
     applications (which used to be subclasses of StandardSystemView)
@@ -61,9 +77,14 @@
     Instance variables:
 	resources    ResourcePack       language string translation
 
-	builder      ?                  dont know what that is used for yet,
-					some subclasses (see manchester goodies)
-					depend on this being there.
+	builder      WindowBuilder      a builder who knows how to create
+					a window hierarchy from a specification
+
+
+    Notice: this class was implemented using protocol information
+    from alpha testers and PD code - it may not be complete or compatible to
+    the corresponding ST-80 class. If you encounter any incompatibilities,
+    please forward a note to the ST/X team.
 "
 ! !
 
@@ -99,6 +120,14 @@
 
 openOn:anApplicationModel
     anApplicationModel open
+!
+
+openOnDevice:aDevice
+    "create an instance of the application and open its view
+     on another device.
+     EXPERIMENTAL and unfinished."
+
+    self new openOnDevice:aDevice
 ! !
 
 !ApplicationModel class methodsFor:'change & update'!
@@ -184,10 +213,14 @@
 "/     in all systems, this allows operation without one (unless a spec
 "/     is read later ...)
 "/    "
-"/    builder := WindowBuilder new.
-    builder := UIBuilder new.
-
-    builder application:self.
+    UIBuilder notNil ifTrue:[
+	builder := UIBuilder new.
+    ] ifFalse:[
+	WindowBuilder notNil ifTrue:[
+	    builder := WindowBuilder new.
+	]
+    ].
+    builder notNil ifTrue:[builder application:self].
     resources := self class classResources.
 !
 
@@ -240,19 +273,23 @@
 open
     "open a standard interface"
 
-    self openInterface.
+    self openInterface
 !
 
 openInterface
-    "open a standard interface"
+    "open a standard interface on another device.
+     Subclasses which do not have an interfaceSpec 
+     may want to redefine this method and create & open their view(s)
+     there. (see NewLauncher as an example)."
 
     self openInterface:#windowSpec
 !
 
 openInterface:aSymbol
-    "open an interface; the argument, aSymbol specifies which.
+    "open an interface on another display; 
+     the argument, aSymbol specifies which interface.
      Typically, applications only use one interface, 
-     returned by the windowSpec method."
+     returned by the #windowSpec method."
 
     |spec|
 
@@ -261,8 +298,8 @@
 
     builder window model:self.
     builder window application:self.
-    builder openWithExtent:nil. 
-    self postOpenWith:builder.
+    builder openWithExtent:nil.
+
     ^ builder
 !