2010-06-05 Clojure Mouse Input Adapter

It turns out that the MouseInputAdapter is the best class to use for drawing by toggling the icons. It took me forever to get the mouse button code right. Aaargh!

I’m happy about the little code reorganization, reusing the instances of ImageIcon and MouseInputAdapter.

The result already allows me to toggle between floor tiles and empty tiles:

/pics/gridmapper-1.png

My next plan: Use ’d’ to switch to drawing a door tile. I’ll need to figure out how to rotate the door tile, and how to display the current ’mode’ in some sort of status bar.

​#Clojure

Comments

(Please contact me if you want to remove your comment.)

I need to look into Leiningen and Clojars. There is a nice tutorial available from Alex Osborne.

Leiningen

Clojars

tutorial available from Alex Osborne

I managed to add a keyboard adapter to switch between floor and door drawing.

Next I need to figure out whether drawing a door at the current position is legal, and whether it should be a north-south or an east-west door. Right now the cells on the grid have no understanding of neighborhood. Interesting times! :D

– Alex