Brick CAD

Brick CAD is a CAD (Computer Aided Design) system for designing bricks. (I was going to do Jumbo Jets, but decided bricks were easier!) It features multiple views of the brick as well as text fields for entering new dimensions.

Brick Panel

Brick Panel uses text fields (JTextField). This has several important ramifications:

1. The brick can be modified from the Edit menu or from the text fields. However, the menu items must prompt the user for the new values, while the text fields already contain the new value. But how does a command know if it was issued from a text field or a menu item? I modified AppFactory so that makeCommand takes a third input: the source of the command. This means that AppPanel needs to pass this source in its actionPerformed method:

Command command = factory.makeEditCommand(model, cmmd, ae.getSource());
command.execute();

2. BrickPanel must implement propertyChange so that it can update text fields when the brick is changed from the menus.

Brick View

Brick CAD is an example of a multi-view application. The Brick View is simply a panel divided into three regions, each containing a view.

Source

·       Brick.java

·       BrickPanel.Java

·       SetHeight.java

·       FrontView.java

·       BrickFactory.java