Skip to content

Commit

Permalink
Merge pull request #150 from Open-MBEE/release/4.0.0
Browse files Browse the repository at this point in the history
Release/4.0.0
  • Loading branch information
ivan-gomes authored Jan 14, 2019
2 parents 8672d4e + 60c802e commit ac56d14
Show file tree
Hide file tree
Showing 272 changed files with 1,055 additions and 24,255 deletions.
19 changes: 10 additions & 9 deletions build.gradle

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=3.4.0-rc2
version=4.0.0
group=org.openmbee.magicdraw.mdk
descriptorFile=MDR_Plugin_Model_Development_Kit_91110_descriptor.xml
magicdDrawGroupName=gov.nasa.jpl.cae.magicdraw.mdk
Expand Down
Binary file modified src/main/dist/manual/MDK DocGen UserGuide.pdf
Binary file not shown.
2,713 changes: 0 additions & 2,713 deletions src/main/dist/manual/MDK DocGen UserGuide.xml

This file was deleted.

Binary file modified src/main/dist/manual/MDK UserGuide.pdf
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
1,749 changes: 779 additions & 970 deletions src/main/dist/profiles/SysML Extensions.mdxml

Large diffs are not rendered by default.

Binary file modified src/main/dist/samples/MDK/DocGen.mdzip
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/java/gov/nasa/jpl/mbee/mdk/MDKApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ protected static MDKApplication getInstance() {
}

public static void main(String... args) {
javafx.application.Application.launch(MDKApplication.class);
Application.launch(MDKApplication.class);
}
}
28 changes: 1 addition & 27 deletions src/main/java/gov/nasa/jpl/mbee/mdk/MDKConfigurator.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,6 @@ private void addElementActions(ActionsManager manager, Element e, List<Element>
Stereotype classview = Utils.getViewClassStereotype(project);
Stereotype elementGroupStereotype = Utils.getElementGroupStereotype(project);

// top-level context menu: Refactor With ID
ActionsCategory refactorWithIDActionCat = myCategory(manager, "Refactor With ID", "Refactor With ID");
if (e instanceof com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class & !(e instanceof com.nomagic.uml2.ext.magicdraw.components.mdbasiccomponents.Component)) {
if (manager.getActionFor(ClassToComponentRefactorWithIDAction.DEFAULT_ID) == null) {
refactorWithIDActionCat.addAction(new ClassToComponentRefactorWithIDAction(es));
}
}
if (e instanceof com.nomagic.uml2.ext.magicdraw.components.mdbasiccomponents.Component) {
if (manager.getActionFor(ComponentToClassRefactorWithIDAction.DEFAULT_ID) == null) {
refactorWithIDActionCat.addAction(new ComponentToClassRefactorWithIDAction(es));
}
}

ActionsCategory modelLoad = myCategory(manager, "MMSContext", "MMS");
if (!TicketUtils.isTicketSet(project)) {
ActionsCategory login = getCategory(manager, "LoginOption", "LoginOption", modelLoad);
Expand Down Expand Up @@ -242,10 +229,10 @@ else if (StereotypesHelper.hasStereotypeOrDerived(e, DocGenProfile.userScriptSte
}

// DocGen menu
ActionsCategory category = myCategory(manager, "DocGen", "DocGen");
if (e instanceof Class) {
Class view = (Class) e;
if (StereotypesHelper.hasStereotypeOrDerived(view, viewStereotype)) {
ActionsCategory category = myCategory(manager, "DocGen", "DocGen");
NMAction act = manager.getActionFor(ValidateViewAction.DEFAULT_ID);
if (act == null) {
category.addAction(new ValidateViewAction(view));
Expand Down Expand Up @@ -273,19 +260,6 @@ else if (StereotypesHelper.hasStereotypeOrDerived(e, DocGenProfile.userScriptSte
c.addAction(new InstanceViewpointAction(e));
}
}
ArrayList<Property> selectedProperties = new ArrayList<Property>();
for (Element el : es) {
if (el instanceof Property) {
selectedProperties.add((Property) el);
}
}
if (!(selectedProperties.isEmpty())) {
ActionsCategory c = myCategory(manager, "DocGen", "DocGen");
NMAction act = manager.getActionFor(CreateRestrictedValueAction.DEFAULT_ID);
if (act == null) {
c.addAction(new CreateRestrictedValueAction(selectedProperties));
}
}
}

private void addDiagramActions(ActionsManager manager, DiagramPresentationElement diagram) {
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/gov/nasa/jpl/mbee/mdk/MDKPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class MDKPlugin extends Plugin {
public static final String MAIN_TOOLBAR_CATEGORY_NAME = "MDK";

private static String VERSION;
private static boolean JAVAFX_SUPPORTED;

public static ClassLoader extensionsClassloader;
public static ActionsManager MAIN_TOOLBAR_ACTIONS_MANAGER;

Expand Down Expand Up @@ -151,33 +153,31 @@ private void loadExtensionJars() {
private void configureEnvironmentOptions() {
EnvironmentOptions mdkOptions = Application.getInstance().getEnvironmentOptions();
mdkOptions.addGroup(new MDKOptionsGroup());
EnvironmentOptions.EnvironmentChangeListener mdkEnvOptionsListener = list -> {
Property advancedOptions = MDKOptionsGroup.getMDKOptions().getProperty(MDKOptionsGroup.SHOW_ADVANCED_OPTIONS_ID);
for (Property p : list) {
if (p.equals(advancedOptions) && MDKOptionsGroup.getMDKOptions().isMDKAdvancedOptions()) {
Application.getInstance().getGUILog().log("[INFO] You must restart MagicDraw to show advanced MDK options.");
}
}
};
mdkOptions.addEnvironmentChangeListener(mdkEnvOptionsListener);
}

private void initJavaFX() {
try {
Class.forName("javafx.application.Platform");
} catch (ClassNotFoundException e) {
System.err.println("[WARNING] JavaFX libraries are unavailable. Please add \"-Dorg.osgi.framework.bundle.parent=ext\" to the \"JAVA_ARGS\" line in your properties file(s) in your MagicDraw bin directory and restart.");
System.err.println("[WARNING] JavaFX libraries are unavailable. Please add \"-Dorg.osgi.framework.bundle.parent=ext\" to the \"JAVA_ARGS\" line in the properties file(s) in your MagicDraw bin directory and restart.");
return;
}
new Thread(() -> {
try {
Class<?> clazz = Class.forName("gov.nasa.jpl.mbee.mdk.MDKApplication");
Method method = clazz.getMethod("main", String[].class);
// has to be before invocation since it hangs
MDKPlugin.JAVAFX_SUPPORTED = true;
method.invoke(null, new Object[]{new String[]{}});
} catch (Exception | Error e) {
MDKPlugin.JAVAFX_SUPPORTED = false;
System.err.println("[WARNING] Failed to initialize JavaFX application. JavaFX functionality is disabled.");
e.printStackTrace();
}
}, "JavaFX Init").start();
}

public static boolean isJavaFXSupported() {
return JAVAFX_SUPPORTED;
}
}
12 changes: 5 additions & 7 deletions src/main/java/gov/nasa/jpl/mbee/mdk/MMSConfigurator.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ public void configure(ActionsManager manager) {
GenerateAllViewsAction generateAllViewsAction = new GenerateAllViewsAction();
category.addAction(generateAllViewsAction);

if (MDKOptionsGroup.getMDKOptions() != null && MDKOptionsGroup.getMDKOptions().isMDKAdvancedOptions()) {
MDActionsCategory validateCategory = new MDActionsCategory("MMSMAINVALIDATE", "Validate");
validateCategory.setNested(true);
category.addAction(validateCategory);
ValidateBranchesAction validateBranchesAction = new ValidateBranchesAction();
validateCategory.addAction(validateBranchesAction);
}
MDActionsCategory validateCategory = new MDActionsCategory("MMSMAINVALIDATE", "Validate");
validateCategory.setNested(true);
category.addAction(validateCategory);
ValidateBranchesAction validateBranchesAction = new ValidateBranchesAction();
validateCategory.addAction(validateBranchesAction);
}

}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ public class MDKConstants {
TWC_VERSION_KEY = "twcVersion",
ARTIFACT_IDS_KEY = "_artifactIds",
CHECKSUM_KEY = "checksum",
CONTENT_TYPE_KEY = "contentType";
CONTENT_TYPE_KEY = "contentType",
SYSML_PROFILE_ID = "_11_5EAPbeta_be00301_1147434586638_637562_1900";
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class ViewViewpointValidator implements Runnable {
private ValidationRule exposedElements = new ValidationRule("Exposed Elements", "View has no exposed elements.", ViolationSeverity.WARNING);
private ValidationRule missingViewpointMethod = new ValidationRule("Missing Viewpoint Method", "Viewpoint shall have a method.", ViolationSeverity.ERROR);
private ValidationRule initialNodeMultiplicity = new ValidationRule("Initial Node Multiplicity", "Activity shall have only one initial node.", ViolationSeverity.ERROR);
private ValidationRule outgoingFlowMultiplicity = new ValidationRule("Outgoing Flow Multiplicity", "Activity node shall have only one outgoing flow.", ViolationSeverity.ERROR);
private ValidationRule outgoingFlowMultiplicity = new ValidationRule("Outgoing Flow Multiplicity", "Activity node shall have only one outgoing flow.", ViolationSeverity.WARNING);
private ValidationRule incomingFlowMultiplicity = new ValidationRule("Incoming Flow Multiplicity", "Activity node shall have only one incoming flow.", ViolationSeverity.WARNING);
private ValidationRule missingInitialNode = new ValidationRule("Missing Initial Node", "Activity shall have an initial node.", ViolationSeverity.WARNING);
private ValidationRule stereotypeMultiplicity = new ValidationRule("Stereotype Multiplicity", "Behaviors shall have only one stereotype.", ViolationSeverity.WARNING);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import javax.annotation.CheckForNull;
import java.awt.event.ActionEvent;
import java.util.Collection;
import java.util.function.Function;
import java.util.stream.Collectors;

public class SetViewpointMethodAction extends RuleViolationAction implements AnnotationAction, IRuleViolationAction, Runnable {
private static String DEFAULT_ID = SetViewpointMethodAction.class.getSimpleName();
Expand Down Expand Up @@ -48,7 +50,7 @@ public void execute(Collection<Annotation> annotations) {
Project project = Project.getProject(viewpoint);
SessionManager.getInstance().createSession(project, DEFAULT_ID);
try {
annotations.stream().flatMap(annotation -> annotation.getActions().stream()).filter(action -> action instanceof SetViewpointMethodAction).map(action -> (SetViewpointMethodAction) action).forEach(SetViewpointMethodAction::run);
annotations.stream().flatMap(annotation -> annotation.getActions().stream()).filter(action -> action instanceof SetViewpointMethodAction).map(action -> (SetViewpointMethodAction) action).collect(Collectors.toMap(SetViewpointMethodAction::getViewpoint, Function.identity(), (oldValue, newValue) -> oldValue)).values().forEach(SetViewpointMethodAction::run);
}
finally {
if (SessionManager.getInstance().isSessionCreated(project)) {
Expand All @@ -70,4 +72,12 @@ public void run() {
Operation operation = ViewpointAdditionalDrawAction.createOperation(viewpoint);
operation.getMethod().add(behavior);
}

public Class getViewpoint() {
return viewpoint;
}

public Behavior getBehavior() {
return behavior;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class DBImage extends DocumentElement {
private Diagram image;
private String caption;
private boolean doNotShow;
private boolean excludeFromList;

public DBImage(Diagram diagram) {
this.image = diagram;
Expand Down Expand Up @@ -50,6 +51,14 @@ public void setDoNotShow(boolean b) {
doNotShow = b;
}

public boolean isExcludeFromList() {
return excludeFromList;
}

public void setExcludeFromList(boolean excludeFromList) {
this.excludeFromList = excludeFromList;
}

@Override
public void accept(IDBVisitor v) {
v.visit(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class DBTable extends DocumentElement {
private boolean transpose;
private boolean hideHeaders;
private boolean showIfEmpty;
private boolean excludeFromList;

public List<List<DocumentElement>> getBody() {
return body;
Expand Down Expand Up @@ -71,6 +72,14 @@ public void setShowIfEmpty(boolean showIfEmpty) {
this.showIfEmpty = showIfEmpty;
}

public boolean isExcludeFromList() {
return excludeFromList;
}

public void setExcludeFromList(boolean excludeFromList) {
this.excludeFromList = excludeFromList;
}

/**
* This must be set
*
Expand Down
Loading

0 comments on commit ac56d14

Please sign in to comment.