A class diagram is a collection of classes from your Java projects selected and positioned on a canvas so you can examine their structure and relationships visually.
You would typically use a class diagram:
Java source cannot be modified in any way using AgileJ StructureViews. All diagrams are simply a reflection of the existing Java elements you have in your workspace.