JScratch Dev
Posted: March 26th, 2010 | Author: admin | Filed under: java | No Comments »JScratch Development Notes
This article documents how I set up my development environment for JScratch development. It’s helpful and often crucial for a project’s success to have a detailed documentation on how a development environment is set up.
I. Set Up Development Environment
The JScratch project
Step 1. Install the latest NetBeans
The current NetBeans is 6.8.
Step 2. Build NapKin Look and Feel Plugin from Source
I would like to give JScratch a playful look and I really like Napkin Look & Feel, a Java look and feel plugin that makes the app looks like it is scrawled on a piece of napkin.
Download NapKin 1.0 source from Napkin SourceForge site. Unzip it to
C:\dev\swing\napkin\src.
Create a new NetBeans project based on the Napkin code by “File”>”New Project”, then select “Java”>”Java Free-Form Project”.
Then click “Browse” at the “Location” line and browse to the unzipped directory (C:\dev\swing\napkin\src ). Other fields such as Build Script and Project Name will be automatically filled.
Continue clicking “Next” at each step to accept default settings, until the “Finish” button is clicked. After the project is created, there are still some errors, indicated by the red warning signs.
To fix it, right click the Napkin Look and Feel project and select “Properties”. At the Categories panel, select “Java Sources Classpath”. Click “Add JAR/Folder” button and browse to
lib\jdom-1.0.jar or C:\dev\swing\napkin\src\lib\jdom-1.0.jar. Then click OK to include the jdom-1.0.jar to the build classpath. The warning sign should disappear from the “src” folder but the warning sign still remains on the “test” folder, thus the whole project.
To rid of this error, build the project by right-click expanding build.xml and right click on “jars”, then select “Run Target”.
The “jar” target is an Ant target which build the project source and produce two jars files: napkinlaf.jar and napkinlaf-swingset2.jar. The napkinlaf.jar was built from code in src\src and napkinlaf-swingset2.jar was built from src\swingset. These two jars are stored in jars or C:\dev\swing\napkin\jars. Double click napkinlap-swingset2.jar to see the SwingSet application with the Napkin look and feel.
(OPTIONAL)To add swingset to to the project so you can browse the SwingSet source code, right click on Napkin Look and Fee project, select� “Properties”. Then select “Java Source”, then click “Add Folder” to browse to swingset\src. Click OK to finish the update.
Also, don’t forget to add the napkinlaf.jar to both wingset\src and test packages.
All the warning signs are now gone.
Step 3. Install NetBeans OpenGL Pack
Download NetBeans OpenGL Pack from the openGL Pack plugin site.
Unzip the zipped file to C:\dev\scratchjava\NetBeansPlugins\OpenGLPack. Then open the Plugins window (“Tools”>”Plugins”). Check “Force install into shared directories” in the “Settings” tab.
Then select “Downloaded” tab. Click “Add Plugin”, then browse to C:\dev\scratchjava\NetBeansPlugins\OpenGLPack to select all plugin files. Install all plugins. Restart IDE if asked.
Now you can open any sample project by selecting “File”>”New Project”>”Java OpenGL”, and select either JOGL or RedBook example. The first project to look at from RedBook is the hello.zip project – it’s the HelloWorld in OpenGL.
Step 4. Download jMonkey
jMonkey is a high-performance Open Source game engine written in Java. It has really great documentation. You can find the software, user manuals, and tutorials on jMonkey Wiki. Below is the screenshots of games created using jMonkey (from jMonkey site).
Step 5. (OPTIONAL) Obtain Visual Library Example Code
Download NetBeans Visual Library Example code bundle from NetBeans Visual Library page
Unzip visual.example.zip to C:/dev/scratchjava/
Open project by “File”>”Open Project” and browse to C:/dev/scratchjava. The visual.example project should have a coffee cup icon. Select the visual.example project and click OK.
In the Projects window, right click visual.example and select “Build”. The project should build successfully. Expand visual.example>Source Packages>javaone.demo3, right click ConnectionDemo.java, and select “Run File”. You would see the following image.
Move either A or B around. The connection between them will stay.
An easy way to run all demos is to go to the org.netbean.modules.visual.examples package, right click on “RunDialog.java” and select “Run File”. From this dialog, you can select tests to run.
Step 6. (Optional) Obtain “Filthy Rich Client” NetBeans Plugin
Download the “Filthy Rich Client” NetBeans Plugin from “Filthy Rich Client” site
Save “org-netbeans-modules-allfilthyrichclientsamples.nbm” to C:\dev\scratchjava.
Install the downloaded plugin by opening the Plugins window: “Tools”>”Plugins”. Select “Downloaded” tab and click “Add Plugins …” button.
Browse to org-netbeans-modules-allfilthyrichclientsamples.nbm to load the plugin. Then click “Install” to install this plugin.
Follow the installation wizard to install the plugin. Then click “Close” to close the Plugins windows.
This plugins contains many advanced Swing GUI samples. Test it by selecting “File”>”New Project”>”Samples”>”Filthy Rich Clients”, then select “AnimatedGraphics” from the project list. Click “Finish” to create the project.
NOTE: I still could not get BloomOpenGL to work due to this error:
Method “glCreateShaderObjectARB” not available
II. Preliminary Software Design
III. Build a Prototype Application
Step 1. Research and Learn about the Tools Use
[At least two weeks]
Step 2. Create JScratch Widgets that Look Like Scratch Blocks
[3/23/10 - 3/24/10] Create JScratch Block Widges with Inkscape and NetBeans Visual Library.
Step 3. Create the Main Application
[to add]
Step 4. Handle Interaction between JScratch Widgets
[to add]
Step 5. Sprite Creation
[to add]
Step 6. Content Creation
This is the step when I can post on ShallWeLearn.com, announcing the effort.
Step 7. Add a Stage Area for Displaying Result
[to add]
Step 8. Add Game Publishing Feature and Other Features
Build and package content in an easy-to-use form.
Step 9. Create a JScratch Community Site
Summary
Static content
Step 10. Create a JScratch Community Site for Game Sharing and Forum
Dynamic content.
Deliverable:
JScratch software, the JScratch site, and an E-Book on how to create JScratch
Troubleshooting Tips
If added image files to visual.example, make sure recompile the whole project so the added images are also copied to the appropriate directories in the build directory.� Or else you will have NullPointer exception if tried to load the newly added images.
Helpful References
Follow Through
To Read
- Amy Fowler’s Swing Architecture Overview
- IBM’s Advanced Synth
Leave a Reply