- JavaExamples jk_new_structure
authorvranyj1
Mon, 30 Jul 2012 22:45:40 +0000
branchjk_new_structure
changeset 1573 38d044a80b88
parent 1572 e966fdad0a23
child 1574 e1a4ae7084f4
- JavaExamples changed: #example_1 - HelloWorldExampleS added: #version_SVN - stx_libjava_examples added:13 methods
src/examples/HelloWorldExampleS.st
src/examples/JavaAppletDemo2.st
src/examples/JavaAppletDemo3.st
src/examples/JavaExamples.st
src/examples/Make.proto
src/examples/Make.spec
src/examples/Makefile
src/examples/abbrev.stc
src/examples/bc.mak
src/examples/bmake.bat
src/examples/examples.rc
src/examples/lcmake.bat
src/examples/libInit.cc
src/examples/stx_libjava_examples.st
src/examples/vcmake.bat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/examples/HelloWorldExampleS.st	Mon Jul 30 22:45:40 2012 +0000
@@ -0,0 +1,15 @@
+"{ Package: 'stx:libjava/examples' }"
+
+Object subclass:#HelloWorldExampleS
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Languages-Java-Utilities'
+!
+
+
+!HelloWorldExampleS class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id::                                                                                                                        $'
+! !
--- a/src/examples/JavaAppletDemo2.st	Mon Jul 30 22:42:57 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-"{ NameSpace: CodingExamples_GUI }"
-
-ApplicationModel subclass:#JavaAppletDemo2
-	instanceVariableNames:''
-	classVariableNames:''
-	poolDictionaries:''
-	category:'examples-Java-Applets'
-!
-
-!JavaAppletDemo2 class methodsFor:'documentation'!
-
-documentation
-"
-    Simple app using a java applet
-
-    [author:]
-        Claus Gittinger (cg@betti)
-"
-!
-
-examples
-"
-    examples to be added.
-                                                                [exBegin]
-    JavaAppletDemo2 open
-                                                                [exEnd]
-"
-! !
-
-!JavaAppletDemo2 class methodsFor:'interface specs'!
-
-windowSpec
-    "this window spec was automatically generated by the ST/X UIPainter"
-
-    "do not manually edit this - the painter/builder may not be able to
-     handle the specification if its corrupted."
-
-    "
-     UIPainter new openOnClass:CodingExamples_GUI::JavaAppletDemo2 andSelector:#windowSpec
-     CodingExamples_GUI::JavaAppletDemo2 new openInterface:#windowSpec
-    "
-    "CodingExamples_GUI::JavaAppletDemo2 open"
-
-    <resource: #canvas>
-
-    ^
-     
-       #(#FullSpec
-          #'window:' 
-           #(#WindowSpec
-              #'name:' 'standardSystemView'
-              #'layout:' #(#LayoutFrame 61 0 177 0 369 0 661 0)
-              #'label:' 'unnamed canvas'
-              #'min:' #(#Point 10 10)
-              #'max:' #(#Point 1280 1024)
-              #'bounds:' #(#Rectangle 61 177 370 662)
-              #'usePreferredExtent:' false
-          )
-          #'component:' 
-           #(#SpecCollection
-              #'collection:' 
-               #(
-                 #(#LabelSpec
-                    #'name:' 'label1'
-                    #'layout:' #(#LayoutFrame 0 0.0 7 0 0 1.0 48 0)
-                    #'label:' 'Java applet example 2'
-                    #'style:' #(#FontDescription #times #bold #roman 18)
-                )
-                 #(#ActionButtonSpec
-                    #'name:' 'actionButton1'
-                    #'layout:' #(#AlignmentOrigin 179 0 -14 1 0.5 1)
-                    #'label:' 'dismiss'
-                    #'model:' #closeRequest
-                )
-                 #(#ViewSpec
-                    #'name:' 'view1'
-                    #'layout:' #(#LayoutFrame 0 0.0 60 0.0 0 1.0 -60 1.0)
-                    #'component:' 
-                     #(#SpecCollection
-                        #'collection:' 
-                         #(
-                           #(#JavaAppletComponentSpec
-                              #'name:' 'javaAppletComponent2'
-                              #'layout:' #(#LayoutFrame 0 0.0 1 0.0 0 1.0 -1 1.0)
-                              #'codeURL:' 'Chart.class'
-                              #'codeBaseURL:' 'file:examples/BarChart'
-                              #'parameterDictionary:' 
-                               #(#Dictionary
-                                  'c4_color' 'red'
-                                  'orientation' 'vertical'
-                                  'c2_style' 'solid'
-                                  'columns' '4'
-                                  'title' 'Performance'
-                                  'c3_label' 'Q3'
-                                  'c4' '30'
-                                  'scale value' '5'
-                                  'c1_style' 'striped'
-                                  'c4_style' 'solid'
-                                  'c3_color' 'magenta'
-                                  'c3' '5'
-                                  'c2_label' 'Q2'
-                                  'c2_color ' 'green'
-                                  'c2' '20'
-                                  'c1_color' 'blue'
-                                  'c3_style' 'striped'
-                                  'c1_label' 'Q1'
-                                  'c1' '10'
-                                  'c4_label' 'Q4'
-                              )
-                              #'level:' -1
-                          )
-                        )
-                    )
-                    #'level:' -1
-                )
-              )
-          )
-      )
-
-    "Modified: / 30.1.1998 / 11:38:09 / cg"
-! !
-
-!JavaAppletDemo2 class methodsFor:'documentation'!
-
-version
-    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/examples/JavaAppletDemo2.st,v 1.4 1999/12/23 18:07:15 cg Exp $'
-! !
--- a/src/examples/JavaAppletDemo3.st	Mon Jul 30 22:42:57 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-"{ NameSpace: CodingExamples_GUI }"
-
-ApplicationModel subclass:#JavaAppletDemo3
-	instanceVariableNames:''
-	classVariableNames:''
-	poolDictionaries:''
-	category:'examples-Java-Applets'
-!
-
-!JavaAppletDemo3 class methodsFor:'documentation'!
-
-documentation
-"
-    Java Reversi app
-    This wrapps a Java Reversi Game application into a smalltalk view.
-
-    [author:]
-        Claus Gittinger (cg@betti)
-"
-!
-
-examples
-"
-    examples to be added.
-                                                                [exBegin]
-    JavaAppletDemo3 open
-                                                                [exEnd]
-"
-! !
-
-!JavaAppletDemo3 class methodsFor:'interface specs'!
-
-windowSpec
-    "this window spec was automatically generated by the ST/X UIPainter"
-
-    "do not manually edit this - the painter/builder may not be able to
-     handle the specification if its corrupted."
-
-    "
-     UIPainter new openOnClass:CodingExamples_GUI::JavaAppletDemo3 andSelector:#windowSpec
-     CodingExamples_GUI::JavaAppletDemo3 new openInterface:#windowSpec
-    "
-    "CodingExamples_GUI::JavaAppletDemo3 open"
-
-    <resource: #canvas>
-
-    ^
-     
-       #(#FullSpec
-          #'window:' 
-           #(#WindowSpec
-              #'name:' 'Canvas'
-              #'layout:' #(#LayoutFrame 216 0 173 0 533 0 563 0)
-              #'label:' 'Java Reversi'
-              #'min:' #(#Point 10 10)
-              #'max:' #(#Point 1280 1024)
-              #'bounds:' #(#Rectangle 216 173 534 564)
-              #'usePreferredExtent:' false
-          )
-          #'component:' 
-           #(#SpecCollection
-              #'collection:' 
-               #(
-                 #(#JavaAppletComponentSpec
-                    #'name:' 'javaAppletComponent1'
-                    #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
-                    #'codeURL:' 'KReversi.class'
-                    #'codeBaseURL:' 'file:examples/KReversi'
-                    #'level:' -1
-                )
-              )
-          )
-      )
-
-    "Modified: / 1.2.1998 / 17:48:26 / cg"
-! !
-
-!JavaAppletDemo3 class methodsFor:'documentation'!
-
-version
-    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/examples/JavaAppletDemo3.st,v 1.3 1999/12/23 18:07:26 cg Exp $'
-! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/examples/JavaExamples.st	Mon Jul 30 22:45:40 2012 +0000
@@ -0,0 +1,231 @@
+"
+ COPYRIGHT (c) 1996-2011 by Claus Gittinger
+
+ New code and modifications done at SWING Research Group [1]:
+
+ COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
+                            SWING Research Group, Czech Technical University in Prague
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+
+ [1] Code written at SWING Research Group contains a signature
+     of one of the above copright owners. For exact set of such code,
+     see the differences between this version and version stx:libjava
+     as of 1.9.2010
+"
+"{ Package: 'stx:libjava/examples' }"
+
+Object subclass:#JavaExamples
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Languages-Java-Utilities'
+!
+
+Object subclass:#CDDatabaseHandler
+	instanceVariableNames:'index title artist tag'
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:JavaExamples
+!
+
+!JavaExamples class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 1996-2011 by Claus Gittinger
+
+ New code and modifications done at SWING Research Group [1]:
+
+ COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
+                            SWING Research Group, Czech Technical University in Prague
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+
+ [1] Code written at SWING Research Group contains a signature
+     of one of the above copright owners. For exact set of such code,
+     see the differences between this version and version stx:libjava
+     as of 1.9.2010
+
+"
+! !
+
+!JavaExamples class methodsFor:'examples'!
+
+example_1
+    "A CD .xml parsing example. The parser raises a UserNotification
+     whenever it parses a CD, it raises a UserNotification. The notification
+     is then handled and printed. Demonstrates:
+      - proxy creation
+      - exception handling
+
+    cd.xml may look like:
+
+    <?xml version='1.0' encoding='ISO-8859-1'?>
+    <catalog>
+        <cd>
+            <title>Empire Burlesque</title>
+            <artist>Bob Dylan</artist>
+            <country>USA</country>
+            <company>Columbia</company>
+            <price>10.90</price>
+            <year>1985</year>
+        </cd>
+    </catalog>
+
+
+
+    "
+
+    | factory parser |
+
+    factory := JAVA javax xml parsers SAXParserFactory newInstance.
+    parser := factory newSAXParser getXMLReader.
+    parser setContentHandler: JavaExamples::CDDatabaseHandler new.
+    [
+        parser parse: '/home/jv/Projects/libjava/demo/saxon/cd.xml'.
+    ] on: JAVA java io IOException do:[:ioe|
+        Transcript showCR: 'I/O error: ', ioe getMessage.
+        ioe printStackTrace
+    ] on: UserNotification do:[:un|
+        Transcript showCR: un messageText.
+        un proceed.
+    ]
+
+    "Created: / 13-05-2012 / 18:27:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaExamples::CDDatabaseHandler class methodsFor:'documentation'!
+
+documentation
+"
+    A simple XML CD database parser - a demonstration
+    of stx:libjava capabilities. See JavaExamples>>example_1
+
+    [author:]
+        Jan Vrany <jan.vrany@fit.cvut.cz>
+
+    [instance variables:]
+
+    [class variables:]
+
+    [see also:]
+
+"
+! !
+
+!JavaExamples::CDDatabaseHandler class methodsFor:'initialization'!
+
+initialize
+
+    self lookupObject: JavaLookup instance
+
+    "Created: / 13-05-2012 / 17:24:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!JavaExamples::CDDatabaseHandler methodsFor:'SAX2 interface'!
+
+characters: string offset: off length: len
+
+    tag = 'title'  ifTrue:[
+        title := string copyFrom: off + 1 to: off + len.
+        tag := nil.
+    ].
+    tag = 'artist' ifTrue:[
+        artist := string copyFrom: off + 1 to: off + len.
+        tag := nil.
+    ].
+
+    "Created: / 13-05-2012 / 17:27:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+endDocument
+
+    "Created: / 16-04-2005 / 12:28:31 / janfrog"
+!
+
+endDocumentFragment
+
+    "Created: / 10-08-2007 / 09:22:12 / janfrog"
+!
+
+endElement:namespace localName:localName qName:qName 
+
+
+    qName = 'cd' ifTrue:[
+        index := index + 1.
+        UserNotification notify: 
+            (index printString , '. ', title , ' - ' , artist)
+    ]
+
+    "Created: / 13-05-2012 / 17:38:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+endPrefixMapping:prefix
+
+    "Created: / 16-04-2005 / 12:29:45 / janfrog"
+!
+
+ignorableWhitespace:aString
+
+    "Created: / 16-04-2005 / 12:30:04 / janfrog"
+!
+
+processingInstruction:target data:data
+
+    "Created: / 16-04-2005 / 12:31:04 / janfrog"
+!
+
+setDocumentLocator:aLocator
+
+    "Created: / 16-04-2005 / 12:30:37 / janfrog"
+    "Modified: / 13-05-2012 / 17:26:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+skippedEnrity:aString
+
+    "Created: / 16-04-2005 / 12:31:18 / janfrog"
+!
+
+startDocument
+
+    index := 0
+
+    "Created: / 16-04-2005 / 12:31:25 / janfrog"
+    "Modified: / 13-05-2012 / 17:30:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+startDocumentFragment
+
+    "Created: / 10-08-2007 / 09:22:07 / janfrog"
+!
+
+startElement:namespace localName:localName qName:qName attributes:attributes
+
+    tag := qName.
+
+    "Created: / 13-05-2012 / 17:37:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+startPrefix:prefix mappingTo:uri
+
+    "Created: / 17-04-2005 / 08:47:18 / janfrog"
+! !
+
+!JavaExamples class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id::                                                                                                                        $'
+! !
+
+JavaExamples::CDDatabaseHandler initialize!
--- a/src/examples/Make.proto	Mon Jul 30 22:42:57 2012 +0000
+++ b/src/examples/Make.proto	Mon Jul 30 22:45:40 2012 +0000
@@ -1,30 +1,142 @@
-# $Header: /cvs/stx/stx/libjava/examples/Make.proto,v 1.2 2011/08/18 18:42:48 vrany Exp $
+# $Header$
 #
-# -- Make.proto created from project at 'From Smalltalk/X, Version:3.5.5 on 8-nov-1999 at 21:44:28'                     
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_libjava_examples.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
 #
-# Warning: YOU SHOULD NOT MODIFY THIS FILE - MODIFY THE .prj FILE INSTEAD
-# and let the ProjectBrowser recreate this file.
-# once you modify this file, do not rerun
-# stmkmp or recreate the Make.proto again - otherwise, your changes are lost.
+# The Makefile as generated by this Make.proto supports the following targets:
+#    make         - compile all st-files to a classLib
+#    make clean   - clean all temp files
+#    make clobber - clean all
+#
+# This file contains definitions for Unix based platforms.
+# It shares common definitions with the win32-make in Make.spec.
 
-# module and directory-in-module;
-# these should correspond to the directory hierarchy
-# location (otherwise, ST/X will have a hard time to
-# find out the packages location from its packageID)
-MODULE=stx
-MODULE_DIR=libjava/examples
-
-LIBNAME=examples
 #
 # position (of this package) in directory hierarchy:
 # (must point to ST/X top directory, for tools and includes)
 TOP=../..
+INCLUDE_TOP=$(TOP)/..
 
 # subdirectories where targets are to be made:
 SUBDIRS=
 
+
 # subdirectories where Makefiles are to be made:
 # (only define if different from SUBDIRS)
 # ALLSUBDIRS=
 
-PACKAGE=$(MODULE):$(MODULE_DIR)
+REQUIRED_SUPPORT_DIRS=
+
+# if your embedded C code requires any system includes,
+# add the path(es) here:,
+# ********** OPTIONAL: MODIFY the next lines ***
+# LOCALINCLUDES=-Ifoo -Ibar
+LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/libjava -I$(INCLUDE_TOP)/stx/libbasic
+
+
+# if you need any additional defines for embedded C code,
+# add them here:,
+# ********** OPTIONAL: MODIFY the next lines ***
+# LOCALDEFINES=-Dfoo -Dbar -DDEBUG
+LOCALDEFINES=
+
+LIBNAME=libstx_libjava_examples
+STCLOCALOPT='-package=$(PACKAGE)' -I. $(LOCALINCLUDES) $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -headerDir=.  -varPrefix=$(LIBNAME)
+
+
+# ********** OPTIONAL: MODIFY the next line ***
+# additional C-libraries that should be pre-linked with the class-objects
+LD_OBJ_LIBS=
+LOCAL_SHARED_LIBS=
+
+
+# ********** OPTIONAL: MODIFY the next line ***
+# additional C targets or libraries should be added below
+LOCAL_EXTRA_TARGETS=
+
+OBJS= $(COMMON_OBJS) $(UNIX_OBJS)
+
+
+
+all:: preMake classLibRule postMake
+
+pre_objs::  
+
+
+
+
+# Update SVN revision in stx_libbasic3.st
+ifneq (,$(findstring .svn,$(wildcard .svn)))
+.svnversion: *.st
+	if [ -d .svn ]; then \
+		rev=$(shell svnversion -n); \
+		echo -n $$rev > .svnversion; \
+	else \
+		echo -n exported > .svnversion; \
+	fi
+
+stx_libjava_examples.o: stx_libjava_examples.st .svnversion 
+	if [ -d .svn ]; then \
+		rev2="$(shell printf "%-16s" $$(cat .svnversion))"; \
+		sed -e "s/\"\$$SVN\-Revision:\".*\"\$$\"/\"\$$SVN-Revision:\"\'$$rev2\'\"\$$\"/g" $< > .stx_libjava_examples.svn.st; \
+	fi
+	$(MAKE) CC="$(CLASSLIB_CC)" OPT="$(OPT)" SEPINITCODE="$(SEPINITCODE)" STC="$(STC)" STFILE=.stx_libjava_examples.svn $(O_RULE);
+	mv .stx_libjava_examples.svn.$(O) stx_libjava_examples.$(O) 
+endif
+
+
+
+
+# add more install actions here
+install::
+
+# add more install actions for aux-files (resources) here
+installAux::
+
+# add more preMake actions here
+preMake::
+
+# add more postMake actions here
+postMake:: cleanjunk
+
+prereq: $(REQUIRED_SUPPORT_DIRS)
+	cd ../../libbasic && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libcomp && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libdb && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libboss && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libdb/libodbc && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libdb/libsqlite && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../goodies/sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libui && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libbasic3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libwidg && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libhtml && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libwidg2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../libtool && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../ && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../librun && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+
+
+
+cleanjunk::
+	-rm -f *.s *.s2
+
+clean::
+	-rm -f *.o *.H
+
+clobber:: clean
+	-rm -f *.so *.dll
+
+
+# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)HelloWorldExampleS.$(O) HelloWorldExampleS.$(H): HelloWorldExampleS.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)stx_libjava_examples.$(O) stx_libjava_examples.$(H): stx_libjava_examples.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+
+# ENDMAKEDEPEND --- do not remove this line
+
--- a/src/examples/Make.spec	Mon Jul 30 22:42:57 2012 +0000
+++ b/src/examples/Make.spec	Mon Jul 30 22:45:40 2012 +0000
@@ -1,19 +1,64 @@
-# $Header: /cvs/stx/stx/libjava/examples/Make.spec,v 1.2 2011/08/18 18:42:48 vrany Exp $
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_libjava_examples.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
 #
-# --- Automatically created Make.spec
+# This file contains specifications which are common to all platforms.
+#
 
-TOP=../..
-SUBDIRS=
+# Do NOT CHANGE THESE DEFINITIONS
+# (otherwise, ST/X will have a hard time to find out the packages location from its packageID,
+#  to find the source code of a class and to find the library for a package)
+MODULE=stx
+MODULE_DIR=libjava/examples
+PACKAGE=$(MODULE):$(MODULE_DIR)
 
 
-# ***************************** modify the next line ***
-LIBNAME=libprivate
+# Argument(s) to the stc compiler (stc --usage).
+#  -headerDir=. : create header files locally
+#                (if removed, they will be created as common
+#  -Pxxx       : defines the package
+#  -Zxxx       : a prefix for variables within the classLib
+#  -Dxxx       : defines passed to to CC for inline C-code
+#  -Ixxx       : include path passed to CC for inline C-code
+#  +optspace   : optimized for space
+#  +optspace2  : optimized more for space
+#  +optspace3  : optimized even more for space
+#  +optinline  : generate inline code for some ST constructs
+#  +inlineNew  : additionally inline new
+#  +inlineMath : additionally inline some floatPnt math stuff
+#
+# ********** OPTIONAL: MODIFY the next line(s) ***
+# STCLOCALOPTIMIZATIONS=+optinline +inlineNew
+# STCLOCALOPTIMIZATIONS=+optspace3
+STCLOCALOPTIMIZATIONS=+optspace3
 
 
-EXTRA_TARGTES=
+# Argument(s) to the stc compiler (stc --usage).
+#  -warn            : no warnings
+#  -warnNonStandard : no warnings about ST/X extensions
+#  -warnEOLComments : no warnings about EOL comment extension
+#  -warnPrivacy     : no warnings about privateClass extension
+#
+# ********** OPTIONAL: MODIFY the next line(s) ***
+# STCWARNINGS=-warn
+# STCWARNINGS=-warnNonStandard
+# STCWARNINGS=-warnEOLComments
+STCWARNINGS=-warnNonStandard
 
-OBJS=  \
-    CodingExamples_GUI__JavaAppletDemo1.$(O) \
-    CodingExamples_GUI__JavaAppletDemo2.$(O) \
-    CodingExamples_GUI__JavaAppletDemo3.$(O)
+COMMON_CLASSES= \
+	stx_libjava_examples \
+	HelloWorldExampleS \
+
+
+
 
+COMMON_OBJS= \
+    $(OUTDIR)stx_libjava_examples.$(O) \
+    $(OUTDIR)HelloWorldExampleS.$(O) \
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/examples/Makefile	Mon Jul 30 22:45:40 2012 +0000
@@ -0,0 +1,19 @@
+#
+# DO NOT EDIT
+#
+# make uses this file (Makefile) only, if there is no
+# file named "makefile" (lower-case m) in the same directory.
+# My only task is to generate the real makefile and call make again.
+# Thereafter, I am no longer used and needed.
+#
+
+.PHONY: run
+
+run: makefile
+	$(MAKE) -f makefile
+
+#only needed for the definition of $(TOP)
+include Make.proto
+
+makefile:
+	$(TOP)/rules/stmkmf
--- a/src/examples/abbrev.stc	Mon Jul 30 22:42:57 2012 +0000
+++ b/src/examples/abbrev.stc	Mon Jul 30 22:45:40 2012 +0000
@@ -1,3 +1,6 @@
-CodingExamples_GUI::CodingExamples_GUI__JavaAppletDemo1 CodingExamples_GUI__JavaAppletDemo1 stx:libjava/examples 'examples-Java-Applets' 0
-CodingExamples_GUI::CodingExamples_GUI__JavaAppletDemo2 CodingExamples_GUI__JavaAppletDemo2 stx:libjava/examples 'examples-Java-Applets' 0
-CodingExamples_GUI::CodingExamples_GUI__JavaAppletDemo3 CodingExamples_GUI__JavaAppletDemo3 stx:libjava/examples 'examples-Java-Applets' 0
+# automagically generated by the project definition
+# this file is needed for stc to be able to compile modules independently.
+# it provides information about a classes filename, category and especially namespace.
+JavaExamples JavaExamples stx:libjava/examples 'Languages-Java-Utilities' 0
+stx_libjava_examples stx_libjava_examples stx:libjava/examples '* Projects & Packages *' 3
+HelloWorldExampleS HelloWorldExampleS stx:libjava/examples 'Languages-Java-Utilities' 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/examples/bc.mak	Mon Jul 30 22:45:40 2012 +0000
@@ -0,0 +1,80 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_libjava_examples.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
+#
+# Notice, that the name bc.mak is historical (from times, when only borland c was supported).
+# This file contains make rules for the win32 platform using either borland-bcc or visual-c.
+# It shares common definitions with the unix-make in Make.spec.
+# The bc.mak supports the following targets:
+#    bmake         - compile all st-files to a classLib (dll)
+#    bmake clean   - clean all temp files
+#    bmake clobber - clean all
+#
+# Historic Note:
+#  this used to contain only rules to make with borland 
+#    (called via bmake, by "make.exe -f bc.mak")
+#  this has changed; it is now also possible to build using microsoft visual c
+#    (called via vcmake, by "make.exe -f bc.mak -DUSEVC")
+#
+TOP=..\..
+INCLUDE_TOP=$(TOP)\..
+
+
+
+!INCLUDE $(TOP)\rules\stdHeader_bc
+
+!INCLUDE Make.spec
+
+LIBNAME=libstx_libjava_examples
+RESFILES=examples.res
+
+
+
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\libjava -I$(INCLUDE_TOP)\stx\libbasic
+LOCALDEFINES=
+
+STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES)  -varPrefix=$(LIBNAME)
+LOCALLIBS=
+
+OBJS= $(COMMON_OBJS) $(WIN32_OBJS)
+
+ALL::  classLibRule
+
+classLibRule: $(OUTDIR) $(OUTDIR)$(LIBNAME).dll
+
+!INCLUDE $(TOP)\rules\stdRules_bc
+
+# build all prerequisite packages for this package
+prereq:
+	pushd ..\..\libbasic & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libcomp & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libdb & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libboss & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libdb\libodbc & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libdb\libsqlite & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\goodies\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libui & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libbasic3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libwidg & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libhtml & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libwidg2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\libtool & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd .. & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\librun & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+
+
+
+
+
+# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)HelloWorldExampleS.$(O) HelloWorldExampleS.$(H): HelloWorldExampleS.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)stx_libjava_examples.$(O) stx_libjava_examples.$(H): stx_libjava_examples.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+
+# ENDMAKEDEPEND --- do not remove this line
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/examples/bmake.bat	Mon Jul 30 22:45:40 2012 +0000
@@ -0,0 +1,8 @@
+@REM -------
+@REM make using borland bcc
+@REM type bmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak %*
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/examples/examples.rc	Mon Jul 30 22:45:40 2012 +0000
@@ -0,0 +1,37 @@
+//
+// DO NOT EDIT
+// automagically generated from the projectDefinition: stx_libjava_examples.
+//
+VS_VERSION_INFO VERSIONINFO
+  FILEVERSION     6,2,0,1
+  PRODUCTVERSION  6,2,2,1
+#if (__BORLANDC__)
+  FILEFLAGSMASK   VS_FF_DEBUG | VS_FF_PRERELEASE
+  FILEFLAGS       VS_FF_PRERELEASE | VS_FF_SPECIALBUILD
+  FILEOS          VOS_NT_WINDOWS32
+  FILETYPE        VFT_DLL
+  FILESUBTYPE     VS_USER_DEFINED
+#endif
+
+BEGIN
+  BLOCK "StringFileInfo"
+  BEGIN
+    BLOCK "040904E4"
+    BEGIN
+      VALUE "CompanyName", "eXept Software AG\0"
+      VALUE "FileDescription", "Smalltalk/X Class library (LIB)\0"
+      VALUE "FileVersion", "6.2.0.1\0"
+      VALUE "InternalName", "stx:libjava/examples\0"
+      VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2012\nCopyright eXept Software AG 1998-2012\0"
+      VALUE "ProductName", "Smalltalk/X\0"
+      VALUE "ProductVersion", "6.2.2.1\0"
+      VALUE "ProductDate", "Mon, 30 Jul 2012 22:49:59 GMT\0"
+    END
+
+  END
+
+  BLOCK "VarFileInfo"
+  BEGIN                               //  Language   |    Translation
+    VALUE "Translation", 0x409, 0x4E4 // U.S. English, Windows Multilingual
+  END
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/examples/lcmake.bat	Mon Jul 30 22:45:40 2012 +0000
@@ -0,0 +1,8 @@
+@REM -------
+@REM make using lcc compiler
+@REM type lcmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak USELCC=1 %1 %2
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/examples/libInit.cc	Mon Jul 30 22:45:40 2012 +0000
@@ -0,0 +1,35 @@
+/*
+ * $Header$
+ *
+ * DO NOT EDIT
+ * automagically generated from the projectDefinition: stx_libjava_examples.
+ */
+#define __INDIRECTVMINITCALLS__
+#include <stc.h>
+
+#ifdef WIN32
+# pragma codeseg INITCODE "INITCODE"
+#endif
+
+#if defined(INIT_TEXT_SECTION) || defined(DLL_EXPORT)
+DLL_EXPORT void _libstx_libjava_examples_Init() INIT_TEXT_SECTION;
+// DLL_EXPORT void _libstx_libjava_examples_InitDefinition() INIT_TEXT_SECTION;
+#endif
+
+// void _libstx_libjava_examples_InitDefinition(pass, __pRT__, snd)
+// OBJ snd; struct __vmData__ *__pRT__; {
+// __BEGIN_PACKAGE2__("libstx_libjava_examples__DFN", _libstx_libjava_examples_InitDefinition, "stx:libjava/examples");
+// _stx_137libjava_137examples_Init(pass,__pRT__,snd);
+
+// __END_PACKAGE__();
+// }
+
+void _libstx_libjava_examples_Init(pass, __pRT__, snd)
+OBJ snd; struct __vmData__ *__pRT__; {
+__BEGIN_PACKAGE2__("libstx_libjava_examples", _libstx_libjava_examples_Init, "stx:libjava/examples");
+_HelloWorldExampleS_Init(pass,__pRT__,snd);
+_stx_137libjava_137examples_Init(pass,__pRT__,snd);
+
+
+__END_PACKAGE__();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/examples/stx_libjava_examples.st	Mon Jul 30 22:45:40 2012 +0000
@@ -0,0 +1,121 @@
+"{ Package: 'stx:libjava/examples' }"
+
+LibraryDefinition subclass:#stx_libjava_examples
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'* Projects & Packages *'
+!
+
+
+!stx_libjava_examples class methodsFor:'description'!
+
+excludedFromPreRequisites
+    "list all packages which should be ignored in the automatic
+     preRequisites scan. See #preRequisites for more."
+
+    ^ #(
+    )
+!
+
+preRequisites
+    "list all required packages.
+     This list can be maintained manually or (better) generated and
+     updated by scanning the superclass hierarchies and looking for
+     global variable accesses. (the browser has a menu function for that)
+     Howevery, often too much is found, and you may want to explicitely
+     exclude individual packages in the #excludedFromPrerequisites method."
+
+    ^ #(
+        #'stx:libbasic'    "Object - superclass of HelloWorldExampleS "
+        #'stx:libjava'    "JavaLookup - referenced by JavaExamples::CDDatabaseHandler class>>initialize "
+    )
+! !
+
+!stx_libjava_examples class methodsFor:'description - contents'!
+
+classNamesAndAttributes
+    "lists the classes which are to be included in the project.
+     Each entry in the list may be: a single class-name (symbol),
+     or an array-literal consisting of class name and attributes.
+     Attributes are: #autoload or #<os> where os is one of win32, unix,..."
+
+    ^ #(
+        "<className> or (<className> attributes...) in load order"
+        (JavaExamples autoload)
+        #'stx_libjava_examples'
+        HelloWorldExampleS
+    )
+!
+
+extensionMethodNames
+    "lists the extension methods which are to be included in the project.
+     Entries are 2-element array literals, consisting of class-name and selector."
+
+    ^ #(
+    )
+! !
+
+!stx_libjava_examples class methodsFor:'description - project information'!
+
+applicationIconFileName
+    "Return the name (without suffix) of an icon-file (the app's icon); will be included in the rc-resource file"
+
+    ^ nil
+    "/ ^ self applicationName
+!
+
+companyName
+    "Return a companyname which will appear in <lib>.rc"
+
+    ^ 'eXept Software AG'
+!
+
+description
+    "Return a description string which will appear in vc.def / bc.def"
+
+    ^ 'Smalltalk/X Class library'
+!
+
+legalCopyright
+    "Return a copyright string which will appear in <lib>.rc"
+
+    ^ 'Copyright Claus Gittinger 1988-2012\nCopyright eXept Software AG 1998-2012'
+!
+
+productInstallDirBaseName
+    "Returns a default installDir which will appear in <app>.nsi.
+     This is usually not the one you want to keep"
+
+    ^ (self package asCollectionOfSubstringsSeparatedByAny:':/') last
+!
+
+productName
+    "Return a product name which will appear in <lib>.rc"
+
+    ^ 'Smalltalk/X'
+! !
+
+!stx_libjava_examples class methodsFor:'description - svn'!
+
+svnRepositoryUrlString
+    "Return a SVN repository URL of myself.
+     (Generated since 2011-04-08)
+     Do not make the string shorter!!!!!! We have to use fixed-length keyword!!!!!!
+    "        
+
+    ^ '$URL::                                                                                                                        $'
+!
+
+svnRevisionNr
+    "Return a SVN revision number of myself.
+     This number is updated after a commit"
+
+    ^ "$SVN-Revision:"'nil             '"$"
+! !
+
+!stx_libjava_examples class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id::                                                                                                                        $'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/examples/vcmake.bat	Mon Jul 30 22:45:40 2012 +0000
@@ -0,0 +1,12 @@
+@REM -------
+@REM make using microsoft visual c
+@REM type vcmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+
+@if not defined VSINSTALLDIR (
+	call "C:\Program Files\Microsoft Visual Studio 10.0"\VC\bin\vcvars32.bat
+)
+make.exe -N -f bc.mak -DUSEVC %*
+
+