Reverted back to NSPanel subclass for create diagram panel.
Implemented panel delegate.

Added typedef for diagram type.