Application Framework


After creating the first version of the Decaf editor, I realized that the project needed an application framework. I didn't want a Big Deal framework, such as the Eclipse or NetBeans frameworks. I wanted something more modest, but still with some capability and flexibility. The following graphic shows what I created.

Screenshot, normal application framework showing menu bar on top, icon bar under menu bar and navigation icon bar on left

This is a combination of CommandBar objects living in a JFrame. You can see that the default for most options is disabled — you can't edit if there's nothing to edit, for example. You also see that each bar starts with a "Docking" menu choice or icon. That lets users rearrange to suit their needs or fancies, as the following graphic shows.

Screen shot, application framework with all bars moved to different docking positions

Torn-off, vertical menu bar Torn-off, horizontal icon bar
The user can even tear off command bars creating flying icon bars and menus, as these examples show.

In some applications floating menus are very effective. A set of brushes in a paint program is one example.

I've not shown you how the Docking works because that would invalidate the coming design check. A user is supposed to come to an application built in this AppFramework and begin using the application. A user curious about Docking should click a docking button and not need additional instruction.

So without instruction, let me ask you to take the following test:

  1. Launch the application framework.
  2. Duplicate the arrangement in the second graphic.
  3. Tear off all the command bars.
  4. Return them to their original positions.

Warning: the View menu would let you select command bars, if there were a View menu, but there isn't. So don't close the command bars that you tear off. Redock them.


Applet temporarily unavailable.
This applet is LaunchAppFrame in the applets package. It uses all the classes in the appFramework package, as well as library.Lib. You can view the javadoc and the javasrc.

So how did you do on the test? Actually, I should ask, "How did I do on the test?" It's my design that's being tested. If you had no trouble at all, give me an A. If you couldn't figure out how, I get an F. If you passed the test, thought it was fun and played with it for a bit, it's an A+ design.

Did you happen to pull down the file menu? (That's actually an application-specific item, but I coded it for this sample.) If you did, you saw that it docks just like the docking menus, as the next graphic shows.

Application framework with File menu dropped down

Inspired design? Well, the truth is that I was in a hurry and I hadn't done popup menus. For a quick look I just reused the docking menu methods. I liked what I saw, so I decided that I'd leave it that way for now.


java consultant home page icon