The main reason that I'm interested in it is that I like to draw. But I don't just like to draw for other people, I like to draw pictures as inputs to programming. A framework like JHotDraw gives me most of what I want from a drawing tool in a form that I can easily customize to create visual programming languages or semantic images. More about that to come in later posts.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuZ7nexNTqhnd1MtU2frDo3O3oiWdDCU-lX7ulDhuD0l0TrLFbptgqOPNZ6E0FKRIUx69fuokvpjxGIQkBAxP4ORXnBYFIpgGi2Txu3t0AnOm7R9_3BVLF67F3are8LkK2kZ1jDxUbeFU/s320/jhotdraw_screenshot.jpg)
If you're interested in getting started with JHotDraw, you should be very comfortable with Java. Although the code is pretty readable, there is a lot of it, there is very little up-to-date documentation and the included examples are fairly complex. To help you get started, I'm posting my implementation of the simplest possible JHotDraw application - HelloJHotDraw. This code is based on the latest version of JHotDraw at the time of this writing: v7.4.1 You can find the JavaDoc at http://www.randelshofer.ch/oop/jhotdraw/.
-- code --
import org.jhotdraw.app.SDIApplication;
import org.jhotdraw.samples.draw.DrawApplicationModel;
import org.jhotdraw.samples.draw.DrawView;
public class HelloJHotDraw extends SDIApplication {
public HelloJHotDraw() {
}
/**
* @param args
*/
public static void main(String[] args) {
HelloJHotDraw app = new HelloJHotDraw();
DrawApplicationModel model = new DrawApplicationModel();
model.setViewClass(DrawView.class);
app.setModel(model);
app.launch(args);
}
}
1 comment:
I liked this quote "I like to draw. But I don't just like to draw for other people"
That says a lot about the Keith I know. Made my day.
Post a Comment