package transformation.wizards;

import com.nomagic.magicdraw.core.Application;
import com.nomagic.magicdraw.core.Project;
import com.nomagic.magicdraw.ui.actions.DefaultDiagramAction;


import java.awt.event.ActionEvent;

public class SecureUML_WizardDiagramAction  extends DefaultDiagramAction {

	public SecureUML_WizardDiagramAction()
	{
	super("", "SecureUML model completion check", null, null);
	}
	
	/**
     * Overrides the DefaultDiagramAction method. 
     * Is called when the respective menu element is clicked.
     * Validates the model and calls the SecureUML diagram completion check.
     */
	public void actionPerformed(ActionEvent ae) {

		Project project = Application.getInstance().getProject();
		
		if (project.getActiveDiagram().getDiagramType().getType().equals("Class Diagram") == false) {
			javax.swing.JOptionPane.showMessageDialog( null, "Diagram must be a Class Diagram");
			return;
		}
		
		new SecureUML_Wizard();
		
	}
}
