When I saw Karel program on 8-bit computers I wanted to make own one.
It is good for learning how to use divide and rule for problem solving.
But I didn't have any computer for long time and I used mainframes in my job.
Now I have computer, beautiful language (java) and time for my hobbies.
I wanted to learn some framework I could use as base of application for my hobby and
in my job. Man can't do everything alone. It is too time-consumming and it needs
some experience and skills.
NetBeans Platform offerd me great ground. It is robust, stabil. I can solve only
my domain part. Even, I can create my own file-type with full support.
Creating of NB modules is very good supported from version 6.
I had big plans, small knowledge an experience. So very long time...
I played with the Platform, I passed through tutorials. Next Sun and JUG (Roman)
aranged a good occasion - course about Platform. It was only two days without
practice but I enjoyed it. I thought what I could to create as homework.
All was clear in Prague but to use all in practice was more difficult.
So I joined both wishes together. I created very quickly prototype of Karel's
library to wrap it and use in NB module. (I tried to find some library but
nothing was suitable for me.) It was interesting process. It could be fain
to describe it as experience for other. And psychoanalysts could be useful
these weeks. You notice some part is bad designed. So you make refactoring.
Nothing runs. Than is a break good...
However, base functionality Karel knew. Atomic commands as step, turn left,
turn right, put sign, pick sign, regognized his direction and wall front of him
and if there is any sign under him. He parsed sipmle scripts and executed it.
He could visualise simple GUI for testing. All in English and in Czech
(including commands). Later there were some problems in module testing and JUnit
tests with Czech, so I put off it for this time.
I am sorry for poore graphics. I created pictures for buttons quickly
in MS Paint and converted to png in a batch.
After all came long awaited point. I created Library wrapper module,
Module soute and Module projects and KarelTopComponent. I added my
visualization (I will it create as service in the future.), buttons
and joined library functionality.
Next I created my file-types Karel .kar (by tutorial of course) and .kat
(for command script and for town content) and noticed
that I had wrong named TopComponent and file-type. Its right it was the first
prototype to learn platform usage.
I moved projects from one computer to other, I ommited some modules
I hadn't needed. There came difficulties by running and MultiView usage.
Library karel can write script, but NB module can't it.
Exception by Instal in target platform
[catch] at java.lang.Thread.run(Thread.java:595)
It have happened yet
But Karel is running!
Procedure to run nbKarel :
Create (open) empty NB module project, Install it in target platform and than
install both .nbm modules into this NB instance.
Begin again karel module.
File .kar open in multiview editor (plain and tree).
Runtime of Karel to made as singleton component.
.kat file support - plain and visual
test localization by module using.
Localization edit, import, export.
Rebuild visualising as a service with defualt (karel-core) implementation.
Later use java 2D, NB Visual library, 3D (Brackeen, Java3D, JOGL).
refactoring of karel-core library
write a tutorial ? - step by step through module developing.
It could touch all areas / tutorials
Playng with artifical inteligence - e.g. labyrint, path finding.
generalize part of Karel library and visualising for re-use.
I created visual MultiView for Town .kat but I had troubles
how to synchronize text and visual view (and DataObject).
Finally I made it in TownEditorSupport notifyModified a notifyModifiedVisual,
but it was no clever. I must do it via change listeners.
It is necessary think out object and action placing.
Files for my filetypes are in filetyp package
but resolver, template, TopComponentSettings.xml and TopComponentWstcref.xml
are in base package ???????????? (for next)
I wanted place OpenTownInMainKarelComponent a OpenKarelInMainKarelComponent
to package of filetyp, but I must call to
"final class MainKarelTopComponent extends TopComponent " from base package
so it is not visible.
It is the reason why are these actions in base package.
???? Is it necessary to make inner packages for module ?
The first action in context menu of file (node) is runable by doubleclick.
So I need to order Open, OpenTownInMain and other.
Later add dragging.
NetBeans was angry when I removed modules in Suite module properties
because of dependencies.
Errors by instalation of module
How to determine which modules can be ommited?
It can open .kar a .kat in text editor.
Text and visual MultiView for .kat file.
I must repair robot initial position setting in visual view.
Synchronization of text and view is incorect although it works a little.
File is always signed as changed and requires save.
.kat a .kar are inserted in Main window and used in Karel runtime.
karel can execute commands, define new ones as classical Karel.
Not sufficiently tested, especialy recursion and complex command structures.
(put sources under version control - Mercurial)
Change synchronization of views in Town MultiView
error and runtime messages to Output
dictionary as list later tree
v budoucnu tento tree pak použít k editaci .kar souběžně s textem
předělat KarelException na return state nebo message?
hlášení o chybách do Statusu a do Output
zobrazit slova ve slovníku jako list, později tree
v budoucnu tento tree pak použít k editaci .kar souběžně s textem
zavést include .kar
dlouhodobé TODOs ...
Jaký je zvyk, zkušenost nebo standard s nastavováním Action.isEnabled()?
1) GUI podle stavu komponent (např. zda má co spustit), popř. podle
listeneru na událost property "running" nastaví runAction.setEnabled.
2) RunAction překryje isEnabled() a bude jen testovat karel.engine.isRunning()
3) verze 2) + poříedí si listener na změnu property "running".
Tj. nastavuje se zvenku nebo se o sebe Action postará sama?
Podle mě se musí Action postarat sama - 3).
Dificulties by commands tree programming.
Tree with commands is not refreshed when Main top component gets focus.
It is handled by global listener but it doesn't work.
Application (karlik) can not open files. It needs Java Project modules.
RSS added to Karel's web
Fresh modules to diretc download from web.
Explorer view for dictionary (.kar) content or Main Karel window dictionary content.
Size of application (karlik.zip) was reduced to 8.6 MB compressed and
24.5 MB decompressed by deselecting all modules and selecting
only modules which NB reported as necessary. Great!
It was simpler I supposed.
Output window covers script textarea.
But command list will be moved to navigation area.
Wrong icons of commands.
Syntax coloring and code completion is made via
Manifest syntax coloring sample. Schlieman will
be tested later - it overwrote all till this time
Supply command list actions by tree view.
Sort commands in explorer view by name or dependention structure.
Edit commands in explorer.
code completion 3 - result depending on previous words
saving comment lines into dictionary structure
there is an exception
Karel project support
runtime and error messagesto Output
editing dictionary and commands visual as a tree
add include otherdictionary.kar file to .kar (and tree)
check and test localization of module , karel-core is localized including commands
I copied karel library project, I renamed it to "karel"
and made a little refactoring.
I left testing application in original library and I created
"KarelApp" project with simple swing application.
NOTE: I have some vision: to have base library, elementary
hard made swing application, application based on
Swing Application Framework, application based on NetBeans Platform.
I created empty Karel support module "nbKarel_core" to wrap
Karel's library to run as an application as the first step.
This version contains swing application and NBPlatform application.
NBPlatform application has all functions for running Karel in national
language. But opening/saving of script/town sources is by JFileChooser
in this time to illustrate this feature. But file-types are prepared
in the project.
Integrated Karel library, basic town view and scripts performing.
Basic actions - open and save town and script (clasic),
atomic commands, edit town.
Simple .kar and .kat - Karel's script and town file type
is still not used.
Projects and directory structure was rebuild.
Czech version of page introduction.
Writing of tutorials is in progress now...
File-type support is not used to open/save sources
to illustrate simple implementation of actions.
Karel don't propagate changes of runState property.
TownPanel does not change its size if town is reloading to the bigger.
I did not use Schliemann for language support because it has
been under development yet and did not support my requirements.
I used Editor* modules to support Karel language.
Generic Language Framework module depends on Project modules and
I do not need Project modules.
Simple syntax coloring and code completion.
It is in Main Karel window too but it is dirty made, I think
(by setting of EditorKit into JTextPane. I want to ommit
dependencies which I do need - e.g. on Project modules.)
Favorites module was used as a files Explorer.
I tried to add disks to favorites because I am working on Windows
and Documents and Settings\user is to poor for me.
It is a little ugly by my opinion but it works.
To Do next
Better (context sensitive) code completion.
Add AST tree for scripts.
Formater and indentation and KeystrokeHandler
Multiview editor for Town files (as in 2008-10-10 release).
Desperade experiments and searches went to success. NetBeans Lexer works
using ANTLR lexer by syntax coloring. Antlr lexer knows different languages
but NetBeans lexer must get Locale as a parameter or it has to set language
itself by file name or lang keyword in the first commented line. Otherwise
it gets Locale.getDefault() locale.
Now I will continue working on Parser and using AST generated by ANTLR.
TODO message about uploading.
I expose soures as a zip-file only because I am not able to upload sources
to ¨mercurial work repository by SSH. See according to time.